From 9d9f43cf5824e0cf470203b2e407e01a78ebb6aa Mon Sep 17 00:00:00 2001 From: "kevin.larke" Date: Tue, 12 May 2020 10:43:00 -0400 Subject: [PATCH] cwEuCon.cpp : added _app_msg_decode(). --- cwEuCon.cpp | 81 +++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 75 insertions(+), 6 deletions(-) diff --git a/cwEuCon.cpp b/cwEuCon.cpp index a65fc75..b94ac06 100644 --- a/cwEuCon.cpp +++ b/cwEuCon.cpp @@ -395,7 +395,6 @@ namespace cw { rc_t rc = kOkRC; - // send the initial handshake if((rc = sock::send( fb->eucon->sockMgrH, fb->sockUserId, kInvalidId, buf, bufByteN )) != kOkRC ) { rc = cwLogError(rc,"TCP send failed on fader bank index:%i proto:%i Disconnecting.",fb->fbIndex,fb->protoState); @@ -457,6 +456,73 @@ namespace cw return nullptr; } + + // Heatbeat: 0x03 0x00 0x00 0x00 + // + // channel status zero value + // --------- --------- --------- --------- + // 0x00 0x01 0x00 0x00 0x00 0x00 0x02 0x0b fader + // 0x00 0x01 0x02 0x00 0x00 0x00 0x00 0x01 mute + // 0x00 0x01 0x00 0x01 0x00 0x00 0x00 0x00 touch + // 0x00 0x01 0x04 0x00 0x00 0x00 0x00 0x00 ping + + + void _app_msg_decode(eucon_t* p, fbank_t* fb, const uint8_t* buf, unsigned bufByteN ) + { + unsigned bi = 0; + + while( bifbIndex,type,id,numb,numb); + + bi += incr; + } + + + + } + void _tcpCallback( void* arg, sock::cbOpId_t cbOpId, unsigned userId, unsigned connId, const void* data, unsigned dataByteCnt, const struct sockaddr_in* fromAddr ) { eucon_t* p = static_cast(arg); @@ -541,12 +607,15 @@ namespace cw time::futureMs(fb->nextSendHbTs,fb->eucon->heartBeatPeriodMs); break; - case kRunning_Id: - printf("%i : Rcv: %i : ",fb->fbIndex, dataByteCnt ); - for(unsigned i=0; ifbIndex, dataByteCnt ); + //for(unsigned i=0; ifbIndex,fb->protoState);