File: bluetooth_get_set.py

package info (click to toggle)
gtk-meshtastic-client 1.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,040 kB
  • sloc: python: 4,759; xml: 58; makefile: 3
file content (29 lines) | stat: -rw-r--r-- 715 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
"""Simple program to demo how to use meshtastic library.
   To run: python examples/info.py
"""

import meshtastic
import meshtastic.serial_interface

from enum import Enum

"""
As far as I can tell, this isn't in the
Meshtastic Library
"""
class BLEPINSetting(Enum):
    Random = 0
    Fixed = 1
    Disabled = 2

interface = meshtastic.serial_interface.SerialInterface()
node = interface.getNode('^local')

print(node.localConfig.network)
#print(node.localConfig.bluetooth)

print ("Bluetooth Enabled: " + str(node.localConfig.bluetooth.enabled))
print ("PIN Mode: " + str(BLEPINSetting(node.localConfig.bluetooth.mode).name))
print ("NTP Server: " + str(node.localConfig.bluetooth.fixed_pin))

interface.close()