I'm using a BT program for 1 master and currently 2 (in future: 3) slaves.
It widely uses for the master:
Code: Select all
#define BT_CONN_1 1 // Slave 1
#define OUTBOX_1 1 //
#define INBOX_11 2 //
#define INBOX_12 3 //
#define BT_CONN_2 2 // Slave 2
#define OUTBOX_2 4 //
#define INBOX_21 5 //
#define INBOX_22 6 //
#define BT_CONN_3 3 // Slave 3
#define OUTBOX_3 7 //
#define INBOX_31 8 //
#define INBOX_32 9 //
SendRemoteString(OUTBOX, 1, cmd);
ReceiveRemoteString(INBOX_11, true, msg)
ReceiveRemoteNumber(INBOX, true, ack);
Code: Select all
#define INBOX 1 // for slave 1
#define OUTBOX_1 2
#define OUTBOX_2 3
#define INBOX 4 // for slave 2
#define OUTBOX_1 5
#define OUTBOX_2 6
#define INBOX 7 // for slave 3
#define OUTBOX_1 8
#define OUTBOX_2 9
SendResponseString(OUTBOX_1, out);
ReceiveRemoteString(INBOX, true, in);