lora/lorawan: set functions for keys

Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
deadprogram
2023-01-12 14:52:18 +01:00
parent c149f3d458
commit 1ba616c6a6
3 changed files with 39 additions and 1 deletions
+10
View File
@@ -83,6 +83,16 @@ func (o *Otaa) GetNetID() string {
return hex.EncodeToString(o.NetID[:])
}
func (o *Otaa) SetNetID(netID []uint8) error {
if len(netID) != 3 {
return ErrInvalidNetIDLength
}
copy(o.NetID[:], netID)
return nil
}
// GenerateJoinRequest Generates a LoraWAN Join request
func (o *Otaa) GenerateJoinRequest() ([]uint8, error) {
// TODO: Add checks