Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
attdona committed Sep 26, 2017
1 parent c256c4a commit 8ce11da
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions burba/sys/bocia/bocia_tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,20 +87,6 @@ int16_t bocia_tcp_accept(int16_t server_sock) {
return sock;
}

/**
* @brief AP endpoint for the provisioning client
*/
int comm_handler(bocia_channel_t *rd, unsigned char* data, int len) {
int rc;

DEBUG("tcpserver recv %d bytes\n", len);

//parse the binary protobuf blob
rc = bocia_unmarshall(rd, data, bocia_input_handler);
DEBUG("tcpserver, rc: %d\n", rc);
return 1;
}

void cli_handler(bocia_channel_t *ch) {
int rc = 0;
rc = sl_Recv(ch->fd, buff, MAX_BUFF_SIZE, 0);
Expand All @@ -116,7 +102,7 @@ void cli_handler(bocia_channel_t *ch) {

if(rc > 0) {
buff[rc] = 0;
comm_handler(ch, buff + 1, rc);
bocia_unmarshall(ch, buff+1, bocia_input_handler);
}
else if(rc == 0) {
// connection closed
Expand Down

0 comments on commit 8ce11da

Please sign in to comment.