|
@ -29,10 +29,12 @@ void send_error_receipt(hand_acid_ble_proto_t* rxpacket, int32_t errorcode) { |
|
|
txheader->frame_type = kproto_error_receipt; |
|
|
txheader->frame_type = kproto_error_receipt; |
|
|
txheader->data.errreceipt.ecode = errorcode; |
|
|
txheader->data.errreceipt.ecode = errorcode; |
|
|
// УÑé |
|
|
// УÑé |
|
|
txheader->packetlen = sendlen; |
|
|
|
|
|
_cmdtxbuf[sendlen - 2] = compute_sum(_cmdtxbuf, sendlen - 2); |
|
|
|
|
|
_cmdtxbuf[sendlen - 1] = PACKET_TAIL; |
|
|
|
|
|
uart_send_data(_cmdtxbuf, sendlen); |
|
|
|
|
|
|
|
|
txheader->packetlen = sendlen; |
|
|
|
|
|
|
|
|
|
|
|
PACKET_SET_CHECKSUM(txheader); |
|
|
|
|
|
PACKET_SET_TAIL(txheader); |
|
|
|
|
|
|
|
|
|
|
|
uart_send_data((uint8_t*)txheader, sendlen); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void send_success_receipt(hand_acid_ble_proto_t* rxpacket) { |
|
|
void send_success_receipt(hand_acid_ble_proto_t* rxpacket) { |
|
@ -51,11 +53,10 @@ void send_success_receipt(hand_acid_ble_proto_t* rxpacket) { |
|
|
} |
|
|
} |
|
|
txheader->packetlen = sendlen; |
|
|
txheader->packetlen = sendlen; |
|
|
|
|
|
|
|
|
// УÑé |
|
|
|
|
|
_cmdtxbuf[sendlen - 2] = compute_sum(_cmdtxbuf, sendlen - 2); |
|
|
|
|
|
_cmdtxbuf[sendlen - 1] = PACKET_TAIL; |
|
|
|
|
|
|
|
|
PACKET_SET_CHECKSUM(txheader); |
|
|
|
|
|
PACKET_SET_TAIL(txheader); |
|
|
|
|
|
|
|
|
uart_send_data(_cmdtxbuf, sendlen); |
|
|
|
|
|
|
|
|
uart_send_data((uint8_t*)txheader, sendlen); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void send_connected_event_report(uint8_t cmd, uint8_t connected, uint8_t from_ble_master) { |
|
|
void send_connected_event_report(uint8_t cmd, uint8_t connected, uint8_t from_ble_master) { |
|
@ -74,9 +75,8 @@ void send_connected_event_report(uint8_t cmd, uint8_t connected, uint8_t from_bl |
|
|
txheader->data.connected_event.connected = connected; |
|
|
txheader->data.connected_event.connected = connected; |
|
|
txheader->data.connected_event.from_ble_master = from_ble_master; |
|
|
txheader->data.connected_event.from_ble_master = from_ble_master; |
|
|
|
|
|
|
|
|
// УÑé |
|
|
|
|
|
_cmdtxbuf[sendlen - 2] = compute_sum(_cmdtxbuf, sendlen - 2); |
|
|
|
|
|
_cmdtxbuf[sendlen - 1] = PACKET_TAIL; |
|
|
|
|
|
|
|
|
PACKET_SET_CHECKSUM(txheader); |
|
|
|
|
|
PACKET_SET_TAIL(txheader); |
|
|
|
|
|
|
|
|
uart_send_data(_cmdtxbuf, sendlen); |
|
|
|
|
|
|
|
|
uart_send_data((uint8_t*)txheader, sendlen); |
|
|
} |
|
|
} |