Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
Refers to a basic data structure (also called record).
1
vote
1
answer
3k
views
Casting a struct member between uint8_t and char, with regard to serial transfer
Transfer Sketch
#include <EasyTransfer.h>
//create object
EasyTransfer TransferObject;
//Struct contents must be idential to struct from other board
#define PAYLOAD_SIZE 255
struct SEND_DATA_STRUCTURE … delay(5000);
}
Receive Sketch
#include <EasyTransfer.h>
//create object
EasyTransfer TransferObject;
//Struct contents must be idential to struct from other board
#define PAYLOAD_SIZE 255
struct …
1
vote
4
answers
9k
views
Transfer a struct's data to an external struct via serial?
Send:
typedef struct NWK_DataReq_t
{
uint8_t state;
uint8_t options;
} NWK_DataReq_t;
//Instance struct
NWK_DataReq_t dataRequest;
void setup()
{
//Give it some values
dataRequest.state … = 2;
dataRequest.options = 4;
Serial.begin(9600);
}
void loop()
{
//set variable array to struct length
uint8_t payload[sizeof(dataRequest)];
//copy struct to variable array
memcpy(payload …