lydia6811
Posts: 6
Joined: Wed Oct 01, 2008 10:09 pm

identify data

Wed Oct 01, 2008 10:12 pm

In your simple service code,you receives data from all connected devices. how can i identify the data which device come from.

Jonas
Posts: 2319
Joined: Mon Jan 09, 2006 2:20 pm
Location: Sweden

RE: identify data

Wed Oct 01, 2008 10:28 pm

Well, if you use an asynchronous read you pass the Stream to the callback.

Regards,
Jonas

lydia6811
Posts: 6
Joined: Wed Oct 01, 2008 10:09 pm

RE: identify data

Wed Oct 01, 2008 10:59 pm

would you tell me how to use synchronous read ?
Thanks

Jonas
Posts: 2319
Joined: Mon Jan 09, 2006 2:20 pm
Location: Sweden

RE: identify data

Wed Oct 01, 2008 11:29 pm

Simply exchange BeginRead with Read, though if you expect several connections or a responsive application you need to spin them off in separate threads.
This is not specific for BlueTools however, it would work exactly the same for any server application.

Regards,
Jonas

Return to “BlueTools”