python - How to get acknowledge and stop sending data -
with python-xbee library, have written code send data end point coordinator. have sent data coordinator , coordinator receives data. but, in end point code, after coordinator gets data, want end communication. should write can detect coordinator has recieved data?
i sending data
class xbeesend(concurrent): def __init__(self): self.stopped = false threading.thread.__init__(self) def run(self): try: while self.stopped == false : data_ = str( .... ) xbee.send('tx',frame_id='\x01',dest_addr_long=dest_addr_long,dest_addr="\xff\xfe",data=data_) time.sleep(1) threading.timer(2, self.run()) except: none
you should receive "transmit status" message (frame type 0x88) of success on sending node when coordinator has received message. low-level status message radio (xbee module) has received message, , doesn't guarantee application layer has processed message.
if, example, application had crashed xbee still powered up, still see transmit status of success.
i don't know how configure python-xbee receive copies of transmit status messages. need update code use incrementing frame id (1 255 , 1) , keep table of sent frames. match frame id referenced in transmit status message table know frames have been received.
the python-xbee library should have mode uses new frame id each message sent, , provides information use in table.
Comments
Post a Comment