Skip to content

Commit

Permalink
Add software version string to the stratum mining.subscribe (#197)
Browse files Browse the repository at this point in the history
lgtm
  • Loading branch information
wizkid057 authored Jun 4, 2024
1 parent 4bda726 commit 62693c1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions components/stratum/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ INCLUDE_DIRS
REQUIRES
json
mbedtls
app_update
)
5 changes: 4 additions & 1 deletion components/stratum/stratum_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "stratum_api.h"
#include "cJSON.h"
#include "esp_log.h"
#include "esp_ota_ops.h"
#include "lwip/sockets.h"
#include "utils.h"
#include <stdio.h>
Expand Down Expand Up @@ -299,7 +300,9 @@ int STRATUM_V1_subscribe(int socket, char * model)
{
// Subscribe
char subscribe_msg[BUFFER_SIZE];
sprintf(subscribe_msg, "{\"id\": %d, \"method\": \"mining.subscribe\", \"params\": [\"bitaxe/%s\"]}\n", send_uid++, model);
const esp_app_desc_t *app_desc = esp_ota_get_app_description();
const char *version = app_desc->version;
sprintf(subscribe_msg, "{\"id\": %d, \"method\": \"mining.subscribe\", \"params\": [\"bitaxe/%s (%s)\"]}\n", send_uid++, model, version);
debug_stratum_tx(subscribe_msg);
write(socket, subscribe_msg, strlen(subscribe_msg));

Expand Down

0 comments on commit 62693c1

Please sign in to comment.