Instead of
(bmac_send(BROADCAST_ADDR, (u_char *) "BTWAKEUP", STRLEN("BTWAKEUP")) == 0)
I wrote mistakenly
(bmac_send(BROADCAST_ADDR, (u_char *) "BTWAKEUP", STRLEN("BTWAKEUP") == 0))
which sends an packet with empty payload.
After reviewing the code, it does not catch a payload length of zero. Please clarify if this is intentional. If so clarify/verify if the packet handler is working correctly with a payload length of zero...
Logged In: YES
user_id=687107
Originator: NO
If the user wants to send an empty packet, why not?
It's still one bit of information. :)
I would leave it as it is, as I don't see a reason to not send empty packets.
I'm sure bluetooth also allows to send empty packets, btw.
Logged In: YES
user_id=749518
Originator: YES
Sending empty packets is great, but only if the code will catch this special case.
Was it tested with empty packets? While reviewing the code it seems to not catch this case (e.g. bmac_receive ignores empty packets and will wait longer, instead of returning a data_len of zero), but maybe I am wrong...
Logged In: YES
user_id=687107
Originator: NO
good point. receiving empty packets should work, too. :)
I didn't write or test the code so far.
then I'd suggest to fix the receiving part, to also receive empty packets.