micetools/src/micetools/micekeychip/callbacks/misc.c

20 lines
580 B
C
Raw Permalink Normal View History

2022-06-13 03:22:52 +00:00
#include "callbacks.h"
void mxkPcpVersion(pcpa_t* stream, void* data) {
char* sCache = pcpaGetCommand(stream, "cache");
char* sDevice = pcpaGetCommand(stream, "device");
bool cache = sCache != NULL && strcmp(sCache, "0") == 0;
char version[5];
if (sDevice && strcmp(sDevice, "n2") == 0)
2023-04-10 17:29:59 +00:00
snprintf(version, 5, "%04X", N2_VERSION);
2022-06-13 03:22:52 +00:00
else
2023-04-10 17:29:59 +00:00
snprintf(version, 5, "%04X", PIC_VERSION);
2022-06-13 03:22:52 +00:00
pcpaSetSendPacket(stream, KC_VERSION, version);
}
void mxkPcpStatus(pcpa_t* stream, void* data) {
2023-04-10 17:29:59 +00:00
pcpaSetSendPacket(stream, KC_STATUS, "available");
2022-06-13 03:22:52 +00:00
}