NXC: BT NXT to NXT msg from slave to master
Posted: 23 Feb 2012, 14:30
hi,
if I send a string from a BT slave to the master via outbox to the corresponding master's inbox is there a way to get an acknowledgement checksum number (for error checking) from the master immediately back?
Sending from the master to a slave it's clear - but how about other way round?
(on each slave I have 1 inbox and 2 outboxes,
the master has for each slave 1 outbox and 2 inboxes).
or how else can I check if the master received all the slave's message correctly?
if I send a string from a BT slave to the master via outbox to the corresponding master's inbox is there a way to get an acknowledgement checksum number (for error checking) from the master immediately back?
Sending from the master to a slave it's clear - but how about other way round?
(on each slave I have 1 inbox and 2 outboxes,
the master has for each slave 1 outbox and 2 inboxes).
Code: Select all
int checksum(string s) {
int cs=0;
for (int i=0;i<strlen(s);++i) cs+=s[i];
return cs;
}
//...
string out="1234567890test";
int check;
check=checksum(out);
do {
SendResponseString(OUTBOX_1, out);
GetResponseNumber(ack,INBOX); // <<<<<<<<<<<< ?
while(ack!=check);
}
Wait(10);