basic info.json handling
This commit is contained in:
parent
1fbbd72c14
commit
ff1bb76537
7 changed files with 210 additions and 82 deletions
|
|
@ -16,7 +16,6 @@
|
|||
|
||||
#include <quantum.h>
|
||||
#include <xap.h>
|
||||
#include <info_json_gz.h>
|
||||
|
||||
void xap_respond_failure(xap_token_t token, xap_response_flags_t response_flags) {
|
||||
xap_send(token, response_flags, NULL, 0);
|
||||
|
|
@ -41,3 +40,18 @@ bool xap_respond_u32(xap_token_t token, uint32_t value) {
|
|||
uint32_t xap_route_qmk_ffffffffffffffff_getter(void) {
|
||||
return 0x12345678;
|
||||
}
|
||||
|
||||
bool xap_respond_info_json_gz(xap_token_t token, const uint8_t *data, size_t data_len) {
|
||||
if (data_len != 2) {
|
||||
xap_respond_failure(token, 0);
|
||||
return false;
|
||||
}
|
||||
|
||||
uint8_t blob[32] = {0};
|
||||
uint16_t offset = ((uint16_t)data[0]) << 8 | data[1];
|
||||
|
||||
void get_info_json_chunk(uint8_t * data, size_t offset);
|
||||
get_info_json_chunk(blob, offset);
|
||||
|
||||
return xap_respond_data(token, blob, 32);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue