added condition to limit send packet size to 252 bytes
This commit is contained in:
		
							parent
							
								
									187390e375
								
							
						
					
					
						commit
						e4d10a9f13
					
				
							
								
								
									
										2
									
								
								main.py
								
								
								
								
							
							
						
						
									
										2
									
								
								main.py
								
								
								
								
							| 
						 | 
					@ -27,7 +27,7 @@ while True:
 | 
				
			||||||
    packet = None
 | 
					    packet = None
 | 
				
			||||||
    packet = rfm.receive()
 | 
					    packet = rfm.receive()
 | 
				
			||||||
    ser_data = bytearray()
 | 
					    ser_data = bytearray()
 | 
				
			||||||
    while ser.inWaiting() > 0:
 | 
					    while ser.inWaiting() > 0 and len(ser_data) <= 252:
 | 
				
			||||||
        recieved_byte = ser.read(1)
 | 
					        recieved_byte = ser.read(1)
 | 
				
			||||||
        ser_data += recieved_byte
 | 
					        ser_data += recieved_byte
 | 
				
			||||||
    if ser_data == b'':
 | 
					    if ser_data == b'':
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue