Skip to content

Update sx128x.c #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/sx128x.c
Original file line number Diff line number Diff line change
Expand Up @@ -635,16 +635,17 @@ sx128x_status_t sx128x_set_pkt_type( const void* context, const sx128x_pkt_type_

sx128x_status_t sx128x_get_pkt_type( const void* context, sx128x_pkt_type_t* pkt_type )
{
uint8_t pkt_type_raw;
uint8_t pkt_type_raw[SX128X_SIZE_GET_PKT_TYPE] = {0};

const uint8_t buf[SX128X_SIZE_GET_PKT_TYPE] = {
SX128X_GET_PKT_TYPE,
SX128X_NOP,
SX128X_NOP
};

sx128x_status_t status =
( sx128x_status_t ) sx128x_hal_read( context, buf, SX128X_SIZE_GET_PKT_TYPE, &pkt_type_raw, 1 );
*pkt_type = ( sx128x_pkt_type_t ) pkt_type_raw;
( sx128x_status_t ) sx128x_hal_read( context, buf, SX128X_SIZE_GET_PKT_TYPE, pkt_type_raw, SX128X_SIZE_GET_PKT_TYPE );
*pkt_type = ( sx128x_pkt_type_t ) pkt_type_raw[2];

return status;
}
Expand Down