Skip to content

Fixed Mode #83

@Oleg-Perevyshin

Description

@Oleg-Perevyshin

Hello!
Very cool library, thank you!
I want to send data in Fixed mode.
To do this I need to set OPT_FMENABLE and create a function that will accept addresses and a channel.

I created a function in the library to send a structure.
But I don't know how to do it correctly.
Can you help me add functionality to the library?

bool EBYTE::SendStructFixed(const void *TheStructure, uint16_t size_, const uint8_t ADDH, const uint8_t ADDL, const uint8_t CHAN) {
  const uint8_t addh_old = GetAddressH();
  const uint8_t addl_old = GetAddressL();
  const uint8_t chan_old = GetChannel();
  SetAddressH(ADDH);
  SetAddressL(ADDL);
  SetChannel(CHAN);
  SaveParameters(TEMPORARY);
  
  _buf = _s->write((uint8_t *)TheStructure, size_);
  CompleteTask(1000);

  SetAddressH(addh_old);
  SetAddressL(addl_old);
  SetChannel(chan_old);
  SaveParameters(TEMPORARY);

  return (_buf == size_);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions