Skip to content

Commit

Permalink
debug stratum communication (wip)
Browse files Browse the repository at this point in the history
  • Loading branch information
Georges760 committed Aug 28, 2024
1 parent 758c560 commit c2f400e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#![no_main]

use core::str::FromStr;
use defmt::{debug, error, info};
use defmt::{debug, error, info, trace};
use embassy_executor::Spawner;
use embassy_net::{tcp::TcpSocket, Config, Ipv4Address, Stack, StackResources};
use embassy_sync::{blocking_mutex::raw::NoopRawMutex, mutex::Mutex, signal::Signal};
Expand Down Expand Up @@ -115,7 +115,6 @@ async fn main(spawner: Spawner) -> ! {
mk_static!([u8; 1536], [0; 1536]),
mk_static!([u8; 1536], [0; 1536]),
);
socket.set_timeout(Some(embassy_time::Duration::from_secs(3)));

let remote_endpoint = (Ipv4Address::new(68, 235, 52, 36), 21496); // public-pool
info!("connecting to pool...");
Expand Down Expand Up @@ -149,8 +148,10 @@ async fn main(spawner: Spawner) -> ! {
subscribe_extranonce: None,
info: None,
};
let mut client = client.lock().await;
client.send_configure(exts).await.unwrap();
{
let mut client = client.lock().await;
client.send_configure(exts).await.unwrap();
}
loop {
Timer::after(Duration::from_millis(5_000)).await;
}
Expand All @@ -167,6 +168,7 @@ async fn stratum_v1_rx_task(
loop {
// ticker.next().await;
let mut client = client.lock().await;
trace!("Polling message...");
match client.poll_message().await {
Ok(msg) => {
if let Some(msg) = msg {
Expand Down

0 comments on commit c2f400e

Please sign in to comment.