How to use the rak811.rak811.Rak811EventError function in rak811

To help you get started, we’ve selected a few rak811 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github AmedeeBulle / pyrak811 / rak811 / rak811.py View on Github external
# Check for downlink
        for event in events:
            # Format: ,[,][,],[,<data>]
            event_items = event.split(',')
            status = event_items.pop(0)
            status = self._int(status)
            if status == EventCode.RECV_DATA:
                self._add_downlink(event_items)
        # Check for errors
        for event in events:
            status = event.split(',')[0]
            status = self._int(status)
            if status not in (EventCode.RECV_DATA,
                              EventCode.TX_COMFIRMED,
                              EventCode.TX_UNCOMFIRMED):
                raise Rak811EventError(status)
</data>
github AmedeeBulle / pyrak811 / rak811 / rak811.py View on Github external
- dev_eui
            - app_eui
            - app_key

        This call is "blocking", it will return only after the join completes.
        The following exceptions can be raised:
            - Rak811TimeoutError: join didn't succeed in time
            - Rak811EventError: join failed
        """
        self._send_command('join=otaa')
        # Waiting join completion
        for event in self._get_events():
            status = event.split(',')[0]
            status = self._int(status)
            if status != EventCode.JOINED_SUCCESS:
                raise Rak811EventError(status)
github AmedeeBulle / pyrak811 / rak811 / rak811.py View on Github external
data = hexlify(data).decode('ascii')

        self._send_command('txc=' + ','.join((
            str(cnt),
            str(interval * 1000),
            data
        )))

        # Process events
        events = self._get_events((cnt * (interval + 10)) - interval)
        # Check for errors
        for event in events:
            status = event.split(',')[0]
            status = self._int(status)
            if status != EventCode.P2PTX_COMPLETE:
                raise Rak811EventError(status)