mirror of
https://github.com/meshcore-dev/meshcore_py.git
synced 2026-09-14 17:56:38 +00:00
set custom vars
This commit is contained in:
Executable
+17
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import asyncio
|
||||
from meshcore import MeshCore
|
||||
from meshcore import BLEConnection
|
||||
|
||||
ADDRESS = "T1000_S" # node ble adress or name
|
||||
|
||||
async def main () :
|
||||
con = BLEConnection(ADDRESS)
|
||||
await con.connect()
|
||||
mc = MeshCore(con)
|
||||
await mc.connect()
|
||||
|
||||
print(await mc.commands.get_custom_vars())
|
||||
|
||||
asyncio.run(main())
|
||||
Executable
+20
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import asyncio
|
||||
from meshcore import MeshCore
|
||||
from meshcore import BLEConnection
|
||||
|
||||
ADDRESS = "T1000_S" # node ble adress or name
|
||||
VAR = "gps"
|
||||
VALUE = "1"
|
||||
|
||||
async def main () :
|
||||
con = BLEConnection(ADDRESS)
|
||||
await con.connect()
|
||||
mc = MeshCore(con, debug=True)
|
||||
await mc.connect()
|
||||
|
||||
print(await mc.commands.set_custom_var(VAR, VALUE))
|
||||
|
||||
|
||||
asyncio.run(main())
|
||||
Reference in New Issue
Block a user