Continue OO migration
This commit is contained in:
@@ -244,7 +244,7 @@ static int serialQueueCount = 0;
|
|||||||
// @param[in] len is the count of bytes in the message
|
// @param[in] len is the count of bytes in the message
|
||||||
// @returns false if the queue (which is a fixed size) is full.
|
// @returns false if the queue (which is a fixed size) is full.
|
||||||
//
|
//
|
||||||
bool ProcessSerialQueue(const uint8_t *p = NULL, uint16_t len = 0);
|
//bool ProcessSerialQueue(const uint8_t *p = NULL, uint16_t len = 0);
|
||||||
|
|
||||||
|
|
||||||
// ProcessSerialReceive
|
// ProcessSerialReceive
|
||||||
@@ -295,12 +295,12 @@ const UserCmd_T UserCommands[] = {
|
|||||||
{ 'm', "Vol 1 UnMute", {"\x02" "07EA3" "\x03", 7} },
|
{ 'm', "Vol 1 UnMute", {"\x02" "07EA3" "\x03", 7} },
|
||||||
{ 'O', "OSD Test Message", },
|
{ 'O', "OSD Test Message", },
|
||||||
{ 'T', "Tuning freq rqst", {"\x02" "22000" "\x03", 7} },
|
{ 'T', "Tuning freq rqst", {"\x02" "22000" "\x03", 7} },
|
||||||
{ 'Y', "Main Vol rqst", {"\x02" "22001" "\x03", 7} },
|
{ 'Y', "Zone 1 Vol rqst", {"\x02" "22001" "\x03", 7} },
|
||||||
{ 'y', "Zone 2 Vol rqst", {"\x02" "22002" "\x03", 7} },
|
{ 'y', "Zone 2 Vol rqst", {"\x02" "22002" "\x03", 7} },
|
||||||
{ 'U', "Input Name rqst", {"\x02" "22003" "\x03", 7} },
|
{ 'U', "Zone 1 Input rqst", {"\x02" "22003" "\x03", 7} },
|
||||||
{ 'u', "Zone 2 Name rqst", {"\x02" "22004" "\x03", 7} },
|
{ 'u', "Zone 2 Input rqst", {"\x02" "22004" "\x03", 7} },
|
||||||
{ 'I', "Zone 2 Vol rqst", {"\x02" "22005" "\x03", 7} },
|
{ 'I', "Zone 3 Vol rqst", {"\x02" "22005" "\x03", 7} },
|
||||||
{ 'i', "Zone 2 Name rqst", {"\x02" "22006" "\x03", 7} },
|
{ 'i', "Zone 3 Input rqst", {"\x02" "22006" "\x03", 7} },
|
||||||
//{ 'J', "Dual Mono - Main", {"\x02" "07E93" "\x03", 7} },
|
//{ 'J', "Dual Mono - Main", {"\x02" "07E93" "\x03", 7} },
|
||||||
//{ 'K', "Dual Mono - Sub", {"\x02" "07E94" "\x03", 7} },
|
//{ 'K', "Dual Mono - Sub", {"\x02" "07E94" "\x03", 7} },
|
||||||
//{ 'L', "Dual Mono - All", {"\x02" "07E95" "\x03", 7} },
|
//{ 'L', "Dual Mono - All", {"\x02" "07E95" "\x03", 7} },
|
||||||
@@ -601,6 +601,7 @@ bool SerialSend(const uint8_t *p, uint16_t len) {
|
|||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
bool ProcessSerialQueue(const uint8_t *p, uint16_t len) {
|
bool ProcessSerialQueue(const uint8_t *p, uint16_t len) {
|
||||||
bool retVal = false; // assume fail
|
bool retVal = false; // assume fail
|
||||||
static bool freshData = false;
|
static bool freshData = false;
|
||||||
@@ -629,7 +630,7 @@ bool ProcessSerialQueue(const uint8_t *p, uint16_t len) {
|
|||||||
}
|
}
|
||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void EmitSpinner() {
|
void EmitSpinner() {
|
||||||
static int x = 0;
|
static int x = 0;
|
||||||
@@ -669,7 +670,7 @@ void EmitRuntimeHelp() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
// PCMessage
|
// PCMessage
|
||||||
//
|
//
|
||||||
// Various responses need to be formatted and shown on screen
|
// Various responses need to be formatted and shown on screen
|
||||||
@@ -700,7 +701,7 @@ static void PCMessage(const char *msg, int len, uint8_t **src, const char * (fnc
|
|||||||
Console_AdvanceToNextLineIfNotRoomFor(26);
|
Console_AdvanceToNextLineIfNotRoomFor(26);
|
||||||
Console_Write(outBuf);
|
Console_Write(outBuf);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
@@ -837,11 +838,11 @@ void ProcessKeyboard(void) {
|
|||||||
avr->Power(AVRInterface::AVROnOff_E::eOff);
|
avr->Power(AVRInterface::AVROnOff_E::eOff);
|
||||||
break;
|
break;
|
||||||
case 'O':
|
case 'O':
|
||||||
ProcessSerialQueue((const uint8_t *)"\x02" "21000" "\x03", 7);
|
avr->ProcessSerialQueue("\x02" "21000" "\x03", 7);
|
||||||
ProcessSerialQueue((const uint8_t *)"\x02" "3Test" "\x03", 7);
|
avr->ProcessSerialQueue("\x02" "3Test" "\x03", 7);
|
||||||
ProcessSerialQueue((const uint8_t *)"\x02" "3 Mes" "\x03", 7);
|
avr->ProcessSerialQueue("\x02" "3 Mes" "\x03", 7);
|
||||||
ProcessSerialQueue((const uint8_t *)"\x02" "3sage" "\x03", 7);
|
avr->ProcessSerialQueue("\x02" "3sage" "\x03", 7);
|
||||||
ProcessSerialQueue((const uint8_t *)"\x02" "3 WOW" "\x03", 7);
|
avr->ProcessSerialQueue("\x02" "3 WOW" "\x03", 7);
|
||||||
break;
|
break;
|
||||||
case ':':
|
case ':':
|
||||||
GetAndSendCustomMessage();
|
GetAndSendCustomMessage();
|
||||||
@@ -888,6 +889,19 @@ void ProcessKeyboard(void) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void HexUppercase(char *p) {
|
||||||
|
const char *hex = "0123456789ABCDEF";
|
||||||
|
while (*p) {
|
||||||
|
if (*p >= 'a' && *p <= 'f')
|
||||||
|
*p = *p - 'a' + 'A';
|
||||||
|
if (NULL == strchr(hex, *p)) {
|
||||||
|
*p = '\0';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
p++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void GetAndSendCustomMessage() {
|
void GetAndSendCustomMessage() {
|
||||||
char buf[20];
|
char buf[20];
|
||||||
char msg[30];
|
char msg[30];
|
||||||
@@ -895,10 +909,16 @@ void GetAndSendCustomMessage() {
|
|||||||
Console_ScrollBottomRegion();
|
Console_ScrollBottomRegion();
|
||||||
Console_WriteAt(0, -2, "Enter Hex string to send: ");
|
Console_WriteAt(0, -2, "Enter Hex string to send: ");
|
||||||
gets_s(buf, sizeof(buf));
|
gets_s(buf, sizeof(buf));
|
||||||
|
HexUppercase(buf);
|
||||||
|
if (strlen(buf) != 5) {
|
||||||
|
Console_WriteAt(0, -1, " Invalid. String must be exactly 5 HEX chars");
|
||||||
|
Console_ScrollBottomRegion();
|
||||||
|
} else {
|
||||||
Console_ScrollBottomRegion();
|
Console_ScrollBottomRegion();
|
||||||
sprintf_s(msg, sizeof(msg), "\x02%s\x03", buf);
|
sprintf_s(msg, sizeof(msg), "\x02%s\x03", buf);
|
||||||
avr->ProcessSerialQueue(msg, strlen(msg));
|
avr->ProcessSerialQueue(msg, strlen(msg));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void GetProgName(char *name) {
|
void GetProgName(char *name) {
|
||||||
@@ -1036,7 +1056,7 @@ int __cdecl main(int argc, char *argv[]) {
|
|||||||
//HandleMessage(anyRcvdMsg.message, anyRcvdMsg.len);
|
//HandleMessage(anyRcvdMsg.message, anyRcvdMsg.len);
|
||||||
}
|
}
|
||||||
|
|
||||||
ProcessSerialQueue();
|
//ProcessSerialQueue();
|
||||||
ProcessWindowsMessage();
|
ProcessWindowsMessage();
|
||||||
} while (!UserWantsToExitCanSniff);
|
} while (!UserWantsToExitCanSniff);
|
||||||
DetachSerialPort();
|
DetachSerialPort();
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user