180
"C" Programming Guide For Optimus S/R
3.13.2 Bluetooth - Practice
SPP Application
Call
SetCommType (2, COMM_RF)
to set COM2 to Bluetooth communication.
To initialize the Bluetooth module as SPP Master or Slave, call
open_com (2, BT_SERIALPORT_MASTER)
or
open_com (2, BT_SERIALPORT_SLAVE)
.
Call
com_eot (2)
to detect if connection is completed. For example,
while (1) {
if (com_eot (2)) break;
OSTimeDly (4);
}
Call
write_com()
and
read_com()
to transmit and receive data respectively.
Call
com_eot()
to detect if connection is broken. For example,
if (com_eot (2)) printf ("Connection break");
Call
close_com (2)
to terminate communication and shut down the Bluetooth
module.
DUN Application
Call
SetCommType (2, COMM_RF)
to set COM2 to Bluetooth communication.
Call
open_com (2, BT_DIALUP_NETWORKING)
to initialize the Bluetooth module as
Dial-Up Modem.
Call
com_eot (2)
to detect if connection is completed. For example,
while (1) {
if (com_eot (2)) break;
OSTimeDly (4);
Содержание Optimus R
Страница 1: ...Printed on 20 March 2006 C Programming Guide Version 3 04 02 Optimus S Optimus R...
Страница 6: ......
Страница 8: ...2 C Programming Guide For Optimus S R...
Страница 12: ...6 C Programming Guide For Optimus S R The flow is illustrated as shown below...
Страница 23: ...Chapter 2 Development Environment 17 Different types signed unsigned Different types same size...
Страница 24: ...18 C Programming Guide For Optimus S R...
Страница 220: ...214 C Programming Guide For Optimus S R See Also FlashSize free_memory...
Страница 232: ...226 C Programming Guide For Optimus S R 4 11 Implementation defined Limits limits h float h Refer to limit h and float h...
Страница 238: ...232 C Programming Guide For Optimus S R...