Reputation: 11
I'm using 32feet.NET library for my project, my project is to control a robot using bluetooth protocol. I have to send a char or maybe array of chars as an instruction but unfortunately I'm not familiar with 32feet.NET
(I can just find all bluetooth devices and send a pairing request to any of them so far ) and there is no good Instruction manual on Library support site Could anyone please help me to do basic send/receive operations so I can move forward myself with more complex tasks?
Upvotes: 0
Views: 4473
Reputation: 116178
Here is an example for connection
BluetoothAddress addr = new BluetoothAddress(0x0016756A4CD1);
BluetoothEndPoint ep = new BluetoothEndPoint(addr, BluetoothService.DialupNetworking);
BluetoothClient cln = new BluetoothClient();
cln.Connect(ep);
(DialupNetworking is just an example. You should find in your Robot's manuals which service to connect to) After that you can send and receive bytes using GetStream()
method of BluetoothClient
.
byte[] buf = .....
cln.GetStream().Write(buf, 0, buf.Length);
But what you should send or receive is device-specific and you should read the manuals of your robot.
For example after connecting to DialupNetworking
service of a cell phone you can use AT command set
to send/read SMSs
Upvotes: 2
Reputation: 851
Try http://32feet.codeplex.com/documentation and http://32feet.codeplex.com/wikipage?title=General%20Bluetooth%20Data%20Connections -- these should get you started.
Upvotes: 0