Meshcore.Commands (Meshcore v0.1.0)

Copy Markdown View Source

Every device command in one namespace – the equivalent of Python's meshcore.commands.

The functions are thin delegates; the implementation and detailed documentation live in the topical modules:

All commands take the connection as first argument and return {:ok, %Meshcore.Event{}} or {:error, %Meshcore.Event{}} (see Meshcore.Commands.Base). Timeouts are in milliseconds.

{:ok, event} = Meshcore.Commands.send_device_query(mc)
event.payload.model

Summary

Functions

Functions

add_contact(mc, contact)

See Meshcore.Commands.Contact.add_contact/2.

change_contact_flags(mc, contact, flags)

See Meshcore.Commands.Contact.change_contact_flags/3.

change_contact_path(mc, contact, path, opts \\ [])

See Meshcore.Commands.Contact.change_contact_path/4.

confirm_factory_reset(mc, token)

See Meshcore.Commands.Device.confirm_factory_reset/2.

export_contact(mc, key \\ nil)

See Meshcore.Commands.Contact.export_contact/2.

export_private_key(mc)

See Meshcore.Commands.Device.export_private_key/1.

fetch_all_neighbours(mc, contact, opts \\ [])

See Meshcore.Commands.Binary.fetch_all_neighbours/3.

force_unscoped(mc)

See Meshcore.Commands.Messaging.force_unscoped/1.

get_advert_path(mc, key)

See Meshcore.Commands.Contact.get_advert_path/2.

get_allowed_repeat_freq(mc)

See Meshcore.Commands.Device.get_allowed_repeat_freq/1.

get_autoadd_config(mc)

See Meshcore.Commands.Contact.get_autoadd_config/1.

get_bat(mc)

See Meshcore.Commands.Device.get_bat/1.

get_channel(mc, channel_idx)

See Meshcore.Commands.Device.get_channel/2.

get_contact_by_key(mc, pubkey)

See Meshcore.Commands.Contact.get_contact_by_key/2.

get_contacts(mc, opts \\ [])

See Meshcore.Commands.Contact.get_contacts/2.

get_contacts_async(mc, lastmod \\ 0)

See Meshcore.Commands.Contact.get_contacts_async/2.

get_custom_vars(mc)

See Meshcore.Commands.Device.get_custom_vars/1.

get_default_flood_scope(mc)

See Meshcore.Commands.Messaging.get_default_flood_scope/1.

get_msg(mc, opts \\ [])

See Meshcore.Commands.Messaging.get_msg/2.

get_path_hash_mode(mc)

See Meshcore.Commands.Device.get_path_hash_mode/1.

get_self_telemetry(mc)

See Meshcore.Commands.Device.get_self_telemetry/1.

get_stats_core(mc)

See Meshcore.Commands.Device.get_stats_core/1.

get_stats_packets(mc)

See Meshcore.Commands.Device.get_stats_packets/1.

get_stats_radio(mc)

See Meshcore.Commands.Device.get_stats_radio/1.

get_time(mc)

See Meshcore.Commands.Device.get_time/1.

get_tuning(mc)

See Meshcore.Commands.Device.get_tuning/1.

has_connection(mc)

See Meshcore.Commands.Device.has_connection/1.

import_contact(mc, card_data)

See Meshcore.Commands.Contact.import_contact/2.

import_private_key(mc, key)

See Meshcore.Commands.Device.import_private_key/2.

reboot(mc)

See Meshcore.Commands.Device.reboot/1.

remove_contact(mc, key)

See Meshcore.Commands.Contact.remove_contact/2.

req_acl(mc, contact, opts \\ [])

See Meshcore.Commands.Binary.req_acl/3.

req_acl_sync(mc, contact, opts \\ [])

See Meshcore.Commands.Binary.req_acl_sync/3.

req_basic_async(mc, contact, opts \\ [])

See Meshcore.Commands.Binary.req_basic_async/3.

req_basic_sync(mc, contact, opts \\ [])

See Meshcore.Commands.Binary.req_basic_sync/3.

req_mma_sync(mc, contact, start_time, end_time, opts \\ [])

See Meshcore.Commands.Binary.req_mma_sync/5.

req_neighbours_async(mc, contact, opts \\ [])

See Meshcore.Commands.Binary.req_neighbours_async/3.

req_neighbours_sync(mc, contact, opts \\ [])

See Meshcore.Commands.Binary.req_neighbours_sync/3.

req_owner_async(mc, contact, opts \\ [])

See Meshcore.Commands.Binary.req_owner_async/3.

req_owner_sync(mc, contact, opts \\ [])

See Meshcore.Commands.Binary.req_owner_sync/3.

req_regions_async(mc, contact, opts \\ [])

See Meshcore.Commands.Binary.req_regions_async/3.

req_regions_sync(mc, contact, opts \\ [])

See Meshcore.Commands.Binary.req_regions_sync/3.

req_status(mc, contact, opts \\ [])

See Meshcore.Commands.Binary.req_status/3.

req_status_sync(mc, contact, opts \\ [])

See Meshcore.Commands.Binary.req_status_sync/3.

req_telemetry(mc, contact, opts \\ [])

See Meshcore.Commands.Binary.req_telemetry/3.

req_telemetry_sync(mc, contact, opts \\ [])

See Meshcore.Commands.Binary.req_telemetry_sync/3.

request_factory_reset(mc)

See Meshcore.Commands.Device.request_factory_reset/1.

reset_default_flood_scope(mc)

See Meshcore.Commands.Messaging.reset_default_flood_scope/1.

reset_flood_scope(mc)

See Meshcore.Commands.Messaging.reset_flood_scope/1.

reset_path(mc, key)

See Meshcore.Commands.Contact.reset_path/2.

run_cli_command(mc, cmd)

See Meshcore.Commands.Device.run_cli_command/2.

send_advert(mc, flood \\ false)

See Meshcore.Commands.Device.send_advert/2.

send_appstart(mc, opts \\ [])

See Meshcore.Commands.Device.send_appstart/2.

send_chan_msg(mc, chan, msg, opts \\ [])

See Meshcore.Commands.Messaging.send_chan_msg/4.

send_channel_data(mc, chan, data_type, payload, opts \\ [])

See Meshcore.Commands.Messaging.send_channel_data/5.

send_cmd(mc, dst, cmd, opts \\ [])

See Meshcore.Commands.Messaging.send_cmd/4.

send_control_data(mc, control_type, payload)

See Meshcore.Commands.ControlData.send_control_data/3.

send_device_query(mc)

See Meshcore.Commands.Device.send_device_query/1.

send_login(mc, dst, pwd)

See Meshcore.Commands.Messaging.send_login/3.

send_login_sync(mc, dst, pwd, opts \\ [])

See Meshcore.Commands.Messaging.send_login_sync/4.

send_logout(mc, dst)

See Meshcore.Commands.Messaging.send_logout/2.

send_msg(mc, dst, msg, opts \\ [])

See Meshcore.Commands.Messaging.send_msg/4.

send_msg_with_retry(mc, dst, msg, opts \\ [])

See Meshcore.Commands.Messaging.send_msg_with_retry/4.

send_node_discover_req(mc, filter, opts \\ [])

See Meshcore.Commands.ControlData.send_node_discover_req/3.

send_path_discovery(mc, dst)

See Meshcore.Commands.Messaging.send_path_discovery/2.

send_path_discovery_sync(mc, dst, opts \\ [])

See Meshcore.Commands.Messaging.send_path_discovery_sync/3.

send_raw_data(mc, payload, path \\ <<>>)

See Meshcore.Commands.Messaging.send_raw_data/3.

send_raw_packet(mc, data, priority \\ 0)

See Meshcore.Commands.Device.send_raw_packet/3.

send_statusreq(mc, dst)

See Meshcore.Commands.Messaging.send_statusreq/2.

send_telemetry_req(mc, dst)

See Meshcore.Commands.Messaging.send_telemetry_req/2.

send_trace(mc, opts \\ [])

See Meshcore.Commands.Messaging.send_trace/2.

set_advert_loc_policy(mc, policy)

See Meshcore.Commands.Device.set_advert_loc_policy/2.

set_autoadd_config(mc, flag)

See Meshcore.Commands.Contact.set_autoadd_config/2.

set_channel(mc, channel_idx, channel_name, channel_secret \\ nil)

See Meshcore.Commands.Device.set_channel/4.

set_coords(mc, lat, lon)

See Meshcore.Commands.Device.set_coords/3.

set_custom_var(mc, key, value)

See Meshcore.Commands.Device.set_custom_var/3.

set_default_flood_scope(mc, scope)

See Meshcore.Commands.Messaging.set_default_flood_scope/2.

set_devicepin(mc, pin)

See Meshcore.Commands.Device.set_devicepin/2.

set_flood_scope(mc, scope, opts \\ [])

See Meshcore.Commands.Messaging.set_flood_scope/3.

set_manual_add_contacts(mc, value)

See Meshcore.Commands.Device.set_manual_add_contacts/2.

set_multi_acks(mc, n)

See Meshcore.Commands.Device.set_multi_acks/2.

set_name(mc, name)

See Meshcore.Commands.Device.set_name/2.

set_other_params(mc, manual_add_contacts, telemetry_base, telemetry_loc, telemetry_env, advert_loc_policy)

See Meshcore.Commands.Device.set_other_params/6.

set_other_params_from_infos(mc, infos)

See Meshcore.Commands.Device.set_other_params_from_infos/2.

set_path_hash_mode(mc, mode)

See Meshcore.Commands.Device.set_path_hash_mode/2.

set_radio(mc, freq, bw, sf, cr, repeat \\ nil)

See Meshcore.Commands.Device.set_radio/6.

set_telemetry_mode_base(mc, mode)

See Meshcore.Commands.Device.set_telemetry_mode_base/2.

set_telemetry_mode_env(mc, mode)

See Meshcore.Commands.Device.set_telemetry_mode_env/2.

set_telemetry_mode_loc(mc, mode)

See Meshcore.Commands.Device.set_telemetry_mode_loc/2.

set_time(mc, val)

See Meshcore.Commands.Device.set_time/2.

set_tuning(mc, rx_dly, af)

See Meshcore.Commands.Device.set_tuning/3.

set_tx_power(mc, val)

See Meshcore.Commands.Device.set_tx_power/2.

share_contact(mc, key)

See Meshcore.Commands.Contact.share_contact/2.

sign(mc, data, opts \\ [])

See Meshcore.Commands.Device.sign/3.

sign_data(mc, chunk)

See Meshcore.Commands.Device.sign_data/2.

sign_finish(mc, opts \\ [])

See Meshcore.Commands.Device.sign_finish/2.

sign_start(mc)

See Meshcore.Commands.Device.sign_start/1.

update_contact(mc, contact, opts \\ [])

See Meshcore.Commands.Contact.update_contact/3.