Documentation ¶
Overview ¶
Package clocksync implements the Application Layer Clock Synchronization v1.0.0 over LoRaWAN.
Index ¶
- Constants
- Variables
- type AppTimeAnsPayload
- type AppTimeAnsPayloadParam
- type AppTimeReqPayload
- type AppTimeReqPayloadParam
- type CID
- type Command
- type CommandPayload
- type Commands
- type DeviceAppTimePeriodicityAnsPayload
- type DeviceAppTimePeriodicityAnsPayloadStatus
- type DeviceAppTimePeriodicityReqPayload
- type DeviceAppTimePeriodicityReqPayloadPeriodicity
- type ForceDeviceResyncReqPayload
- type ForceDeviceResyncReqPayloadForceConf
- type PackageVersionAnsPayload
Constants ¶
const DefaultFPort uint8 = 202
DefaultFPort defines the default fPort value for Clock Synnchronization.
Variables ¶
var (
ErrNoPayloadForCID = errors.New("lorawan/applayer/clocksync: no payload for given CID")
)
Errors
Functions ¶
This section is empty.
Types ¶
type AppTimeAnsPayload ¶
type AppTimeAnsPayload struct { TimeCorrection int32 Param AppTimeAnsPayloadParam }
AppTimeAnsPayload implements the AppTimeAns payload.
func (AppTimeAnsPayload) MarshalBinary ¶
func (p AppTimeAnsPayload) MarshalBinary() ([]byte, error)
MarshalBinary encodes the payload to a slice of bytes.
func (*AppTimeAnsPayload) Size ¶
func (p *AppTimeAnsPayload) Size() int
Size returns the payload size in bytes.
func (*AppTimeAnsPayload) UnmarshalBinary ¶
func (p *AppTimeAnsPayload) UnmarshalBinary(data []byte) error
UnmarshalBinary decoces the payload from a slice of bytes.
type AppTimeAnsPayloadParam ¶
type AppTimeAnsPayloadParam struct {
TokenAns uint8
}
AppTimeAnsPayloadParam implements the AppTimeAns payload Param field.
type AppTimeReqPayload ¶
type AppTimeReqPayload struct { DeviceTime uint32 Param AppTimeReqPayloadParam }
AppTimeReqPayload implements the AppTimeReq payload.
func (AppTimeReqPayload) MarshalBinary ¶
func (p AppTimeReqPayload) MarshalBinary() ([]byte, error)
MarshalBinary encodes the payload to a slice of bytes.
func (AppTimeReqPayload) Size ¶
func (p AppTimeReqPayload) Size() int
Size returns the payload size in bytes.
func (*AppTimeReqPayload) UnmarshalBinary ¶
func (p *AppTimeReqPayload) UnmarshalBinary(data []byte) error
UnmarshalBinary decodes the payload from a slice of bytes.
type AppTimeReqPayloadParam ¶
AppTimeReqPayloadParam implements the AppTimeReq Param field.
type CID ¶
type CID byte
CID defines the command identifier.
type Command ¶
type Command struct { CID CID Payload CommandPayload }
Command defines the Command structure.
func (Command) MarshalBinary ¶
MarshalBinary encodes the command to a slice of bytes.
type CommandPayload ¶
type CommandPayload interface { MarshalBinary() (data []byte, err error) UnmarshalBinary(data []byte) error Size() int }
CommandPayload defines the interface that a command payload must implement.
func GetCommandPayload ¶
func GetCommandPayload(uplink bool, c CID) (CommandPayload, error)
GetCommandPayload returns a new CommandPayload for the given CID.
type Commands ¶
type Commands []Command
Commands defines a slice of commands.
func (Commands) MarshalBinary ¶
MarshalBinary encodes the commands to a slice of bytes.
type DeviceAppTimePeriodicityAnsPayload ¶
type DeviceAppTimePeriodicityAnsPayload struct { Status DeviceAppTimePeriodicityAnsPayloadStatus Time uint32 }
DeviceAppTimePeriodicityAnsPayload implements the DeviceAppTimePeriodicityAns payload.
func (DeviceAppTimePeriodicityAnsPayload) MarshalBinary ¶
func (p DeviceAppTimePeriodicityAnsPayload) MarshalBinary() ([]byte, error)
MarshalBinary encodes the payload to a slice of bytes.
func (DeviceAppTimePeriodicityAnsPayload) Size ¶
func (p DeviceAppTimePeriodicityAnsPayload) Size() int
Size returns the payload size in bytes.
func (*DeviceAppTimePeriodicityAnsPayload) UnmarshalBinary ¶
func (p *DeviceAppTimePeriodicityAnsPayload) UnmarshalBinary(data []byte) error
UnmarshalBinary decodes the payload from a slice of bytes.
type DeviceAppTimePeriodicityAnsPayloadStatus ¶
type DeviceAppTimePeriodicityAnsPayloadStatus struct {
NotSupported bool
}
DeviceAppTimePeriodicityAnsPayloadStatus implements the DeviceAppTimePeriodicityAns status field.
type DeviceAppTimePeriodicityReqPayload ¶
type DeviceAppTimePeriodicityReqPayload struct {
Periodicity DeviceAppTimePeriodicityReqPayloadPeriodicity
}
DeviceAppTimePeriodicityReqPayload implements the DeviceAppTimePeriodicityReq payload.
func (DeviceAppTimePeriodicityReqPayload) MarshalBinary ¶
func (p DeviceAppTimePeriodicityReqPayload) MarshalBinary() ([]byte, error)
MarshalBinary encodes the payload to a slice of bytes.
func (DeviceAppTimePeriodicityReqPayload) Size ¶
func (p DeviceAppTimePeriodicityReqPayload) Size() int
Size returns the payload size in bytes.
func (*DeviceAppTimePeriodicityReqPayload) UnmarshalBinary ¶
func (p *DeviceAppTimePeriodicityReqPayload) UnmarshalBinary(data []byte) error
UnmarshalBinary decodes the payload from a slice of bytes.
type DeviceAppTimePeriodicityReqPayloadPeriodicity ¶
type DeviceAppTimePeriodicityReqPayloadPeriodicity struct {
Period uint8
}
DeviceAppTimePeriodicityReqPayloadPeriodicity implements the DeviceAppTimePeriodicityReq payload Periodicity field.
type ForceDeviceResyncReqPayload ¶
type ForceDeviceResyncReqPayload struct {
ForceConf ForceDeviceResyncReqPayloadForceConf
}
ForceDeviceResyncReqPayload implements the ForceDeviceResyncReq payload.
func (ForceDeviceResyncReqPayload) MarshalBinary ¶
func (p ForceDeviceResyncReqPayload) MarshalBinary() ([]byte, error)
MarshalBinary encodes the payload to a slice of bytes.
func (ForceDeviceResyncReqPayload) Size ¶
func (p ForceDeviceResyncReqPayload) Size() int
Size returns the payload size in bytes.
func (*ForceDeviceResyncReqPayload) UnmarshalBinary ¶
func (p *ForceDeviceResyncReqPayload) UnmarshalBinary(data []byte) error
UnmarshalBinary decodes the payload from a slice of bytes.
type ForceDeviceResyncReqPayloadForceConf ¶
type ForceDeviceResyncReqPayloadForceConf struct {
NbTransmissions uint8
}
ForceDeviceResyncReqPayloadForceConf implements the ForceDeviceResyncReq payload ForceConf field.
type PackageVersionAnsPayload ¶
PackageVersionAnsPayload implements the PackageVersionAns payload.
func (PackageVersionAnsPayload) MarshalBinary ¶
func (p PackageVersionAnsPayload) MarshalBinary() ([]byte, error)
MarshalBinary encodes the payload to a slice of bytes.
func (*PackageVersionAnsPayload) Size ¶
func (p *PackageVersionAnsPayload) Size() int
Size returns the payload size in bytes.
func (*PackageVersionAnsPayload) UnmarshalBinary ¶
func (p *PackageVersionAnsPayload) UnmarshalBinary(data []byte) error
UnmarshalBinary decodes the payload from a slice of bytes.