addmavlinkkeys
Syntax
Description
addmavlinkkeys(
adds the MAVLink keys
stored in the filename
).env
file filename
to the MATLAB® session. Use MAVLink keys in signing channels for message signing. See the
mavlinksigning
object for more details.
Examples
Add and Remove MAVLink Keys
Check the contents of the keys.env
file. The file contains two keys. Key1
is a 32-element uint8
vector and Key2
is a 32-element uint8
vector encoded using base 64 encoding using the matlab.net.base64encode
function.
type keys.env
Key1 = [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 30 31 32] Key2_Base64 = "1xOIT/+tTcjdXaCH794ihyStgzxDll+ZLw3SAzolIu0="
Add the MAVLink keys from the file keys.env
file to the MATLAB session.
addmavlinkkeys("keys.env")
List all of the keys in the current MATLAB session.
keys = lsmavlinkkeys
keys = 1x2 string
"Key1" "Key2"
Remove both the Key
and Key_Base64
MAVLink keys.
rmmavlinkkeys(["Key1","Key2"])
Input Arguments
filename
— MAVLink keys file
string scalar | string array | character vector
MAVLink keys file, specified as a string scalar, string array, or character vector.
Use a string array to add keys from multiple .env
files
simultaneously. You must specify the absolute or relative path to each file, and each
file path must end with ".env"
.
The files store MAVLink keys in one of these formats:
KeyName = KeyValue
, whereKeyName
is the desired key name, andKeyValue
is a 32-elementuint8
vector.KeyName_Base64 = KeyValueStr
, whereKeyName
is the desired key name, andKeyValueStr
is a string scalar converted from a 32-elementuint8
vector using base 64 encoding. For more information about base 64 encoding, see thematlab.net.base64encode
function.
Example: addmavlinkkeys("keys.env")
adds keys from the
"keys.env"
file on the MATLAB path.
Data Types: string
| char
Version History
Introduced in R2023a
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)