syntax = "proto3"; /* * Meshtastic protobufs * * For more information on protobufs (and tools to use them with the language of your choice) see * https://developers.google.com/protocol-buffers/docs/proto3 * * We are not placing any of these defs inside a package, because if you do the * resulting nanopb version is super verbose package mesh. * * Protobuf build instructions: * * To build java classes for reading writing: * protoc -I=. --java_out /tmp mesh.proto * * To generate Nanopb c code: * /home/kevinh/packages/nanopb-0.4.0-linux-x86/generator-bin/protoc --nanopb_out=/tmp -I=app/src/main/proto mesh.proto * * Nanopb binaries available here: https://jpa.kapsi.fi/nanopb/download/ use nanopb 0.4.0 */ option java_package = "com.geeksville.mesh"; option optimize_for = LITE_RUNTIME; option java_outer_classname = "ChannelProtos"; /* * Full settings (center freq, spread factor, pre-shared secret key etc...) * needed to configure a radio for speaking on a particular channel This * information can be encoded as a QRcode/url so that other users can configure * their radio to join the same channel. * A note about how channel names are shown to users: channelname-Xy * poundsymbol is a prefix used to indicate this is a channel name (idea from @professr). * Where X is a letter from A-Z (base 26) representing a hash of the PSK for this * channel - so that if the user changes anything about the channel (which does * force a new PSK) this letter will also change. Thus preventing user confusion if * two friends try to type in a channel name of "BobsChan" and then can't talk * because their PSKs will be different. The PSK is hashed into this letter by * "0x41 + [xor all bytes of the psk ] modulo 26" * This also allows the option of someday if people have the PSK off (zero), the * users COULD type in a channel name and be able to talk. * Y is a lower case letter from a-z that represents the channel 'speed' settings * (for some future definition of speed) * * FIXME: Add description of multi-channel support and how primary vs secondary channels are used. * FIXME: explain how apps use channels for security. explain how remote settings and * remote gpio are managed as an example */ message ChannelSettings { /* * If zero then, use default max legal continuous power (ie. something that won't * burn out the radio hardware) * In most cases you should use zero here. Units are in dBm. */ int32 tx_power = 1; /* * Standard predefined channel settings * Note: these mappings must match ModemConfigChoice in the device code. */ enum ModemConfig { /* * < Bw = 125 kHz, Cr = 4/5, Sf(7) = 128chips/symbol, CRC * < on. Default medium range (5.469 kbps) */ Bw125Cr45Sf128 = 0; /* * < Bw = 500 kHz, Cr = 4/5, Sf(7) = 128chips/symbol, CRC * < on. Fast+short range (21.875 kbps) */ Bw500Cr45Sf128 = 1; /* * < Bw = 31.25 kHz, Cr = 4/8, Sf(9) = 512chips/symbol, * < CRC on. Slow+long range (275 bps) */ Bw31_25Cr48Sf512 = 2; /* * < Bw = 125 kHz, Cr = 4/8, Sf(12) = 4096chips/symbol, CRC * < on. Slow+long range (183 bps) */ Bw125Cr48Sf4096 = 3; } /* * Note: This is the 'old' mechanism for specifying channel parameters. * Either modem_config or bandwidth/spreading/coding will be specified - NOT BOTH. * As a heuristic: If bandwidth is specified, do not use modem_config. * Because protobufs take ZERO space when the value is zero this works out nicely. * This value is replaced by bandwidth/spread_factor/coding_rate. * If you'd like to experiment with other options add them to MeshRadio.cpp in the device code. */ ModemConfig modem_config = 3; /* * Bandwidth in MHz * Certain bandwidth numbers are 'special' and will be converted to the * appropriate floating point value: 31 -> 31.25MHz */ uint32 bandwidth = 6; /* * A number from 7 to 12. Indicates number of chirps per symbol as * 1<