Larger debug of binkp state

This commit is contained in:
Alexey Khromov 2025-03-19 18:56:32 +03:00
parent 0cb9a2b2cf
commit 7fd0d85557

View File

@ -228,6 +228,7 @@ int binkp_loop(s_binkp_state *bstate) {
block_length = read_pos - BINKP_HEADER; block_length = read_pos - BINKP_HEADER;
DEB((D_24554, "binkp: complete block is received %d %hu", block_type, block_length)); DEB((D_24554, "binkp: complete block is received %d %hu", block_type, block_length));
m = binkp_doreceiveblock(bstate, readbuf+BINKP_HEADER, block_type, block_length); m = binkp_doreceiveblock(bstate, readbuf+BINKP_HEADER, block_type, block_length);
DEB((D_24554, "binkp: dorecieveblock result is %d", m));
if(m==1) { if(m==1) {
DEB((D_24554, "block is successfully accepted")); DEB((D_24554, "block is successfully accepted"));
read_pos = 0; read_pos = 0;
@ -651,7 +652,10 @@ bstate->extracmd[0] = BPMSG_ERR; strcpy(bstate->extracmd+1, msg); bstate->extrai
int binkp_doreceiveblock(s_binkp_state *bstate, char *buf, int block_type, unsigned short block_length) int binkp_doreceiveblock(s_binkp_state *bstate, char *buf, int block_type, unsigned short block_length)
{ {
DEB((D_24554, "dorecieveblock_type: %d", block_type));
DEB((D_24554, "dorecieveblock_bytes: %x %x %x %x", buf[0], buf[1], buf[2], buf[3]));
switch (block_type) { switch (block_type) {
case BINKP_BLK_CMD: case BINKP_BLK_CMD:
if (block_length<1) { if (block_length<1) {
PROTO_ERROR("Zero length command received") PROTO_ERROR("Zero length command received")