1
0
Fork 0

Add master send to specific destinations

This commit is contained in:
Fred Sundvik 2016-02-20 14:52:17 +02:00
parent cee5406ed7
commit 82b5037b9d
2 changed files with 38 additions and 2 deletions

View file

@ -32,10 +32,14 @@ void router_set_master(bool master) {
}
void route_incoming_frame(uint8_t link, uint8_t* data, uint16_t size){
transport_recv_frame(0, data, size);
if (data[size-1] & 1) {
transport_recv_frame(0, data, size - 1);
}
data[size-1] >>= 1;
validator_send_frame(DOWN_LINK, data, size);
}
void router_send_frame(uint8_t destination, uint8_t* data, uint16_t size) {
validator_send_frame(DOWN_LINK, data, size);
data[size] = destination;
validator_send_frame(DOWN_LINK, data, size + 1);
}