It's called remote procecure call and it's been done an infinite number of times with infinite variety -- I am kidding about infinity, by definition.
You want to communicate from point A to point B over a specific type of network. Chances are you will write no code on the communications stack. Rather, write mock connection objects (you need to
test your application independently) and finish the application first. Then add in the wireless network API of your choosing.