(add-mavlink-enums {:keys [enum-to-value enums-by-group]}
{:keys [source] :as new-part})
Given two partial mavlink maps (with :enum data only), merge the contents of the second with the first.
Given two partial mavlink maps (with :enum data only), merge the contents of the second with the first.
(add-mavlink-messages {:keys [descriptions messages-by-keyword messages-by-id]
:as mavlink}
{:keys [source] :as new-part})
Given two mavlink maps, merge the contents of the second with the first.
Given two mavlink maps, merge the contents of the second with the first.
(gen-decode-fn {:keys [name-key type-key length enum-type bitmask]}
enums-by-group)
Generate the decode function for a field. Because they have the same structure this function works on both regular fields and extension fields. Note that we depend on gen-encode-fn to catch bitmask errors, there is no need to catch them twice.
Generate the decode function for a field. Because they have the same structure this function works on both regular fields and extension fields. Note that we depend on gen-encode-fn to catch bitmask errors, there is no need to catch them twice.
(gen-encode-bitmask write-fn name-key enum-type enums-by-group)
Generate the encode bitmask function; add error checking to be sure the user supplies valid values for the bitmask. Note that enum-group ro value to enum-key, so the reverse is enum-key to value bindings.
Generate the encode bitmask function; add error checking to be sure the user supplies valid values for the bitmask. Note that enum-group ro value to enum-key, so the reverse is enum-key to value bindings.
(gen-encode-fn {:keys [name-key type-key enum-type length bitmask]}
enums-by-group)
Generate the encode function for a field. Because they have the same structure this function works on both regular fields and extension fields.
Generate the encode function for a field. Because they have the same structure this function works on both regular fields and extension fields.
(get-extension-fields m)
Returns just the extension fields of a message; or nil if there are none.
Returns just the extension fields of a message; or nil if there are none.
(get-fields m)
Returns just the fields of a message; or nil if there are none. While using extentions tag as a separator, this function looks to the left of the tag, if there is no extensions tag, then all the fields are returned.
Returns just the fields of a message; or nil if there are none. While using extentions tag as a separator, this function looks to the left of the tag, if there is no extensions tag, then all the fields are returned.
(get-mavlink-enums {:keys [file-name zipper]})
Return a mavlink map of enum data for one xml source. source {:file-name source file name :zipper zipper of parse tree of source file}
Return a mavlink map of enum data for one xml source. source {:file-name source file name :zipper zipper of parse tree of source file}
(get-mavlink-messages {:keys [file-name zipper]}
{:keys [descriptions retain-fields?]}
{:keys [enums-by-group]})
Return a mavlink map for one xml source. source {:file-name source file name :zipper zipper of parse tree of source file} options the parse options map, only :descriptions tag is referenced mavlink the mavlink map holding the :enum-to-value and :enums-group mappings
Return a mavlink map for one xml source. source {:file-name source file name :zipper zipper of parse tree of source file} options the parse options map, only :descriptions tag is referenced mavlink the mavlink map holding the :enum-to-value and :enums-group mappings
(get-xml-zippers xml-sources)
Open all the xml sources, verify that each source' includes are in the list; return new xml-sources vector with a zipper binding for each source.
Open all the xml sources, verify that each source' includes are in the list; return new xml-sources vector with a zipper binding for each source.
(keywordize s)
Take a string, replace all _ with - and put it in lower case, then convert to a keyword and return it. Not intended for use on type-names
Take a string, replace all _ with - and put it in lower case, then convert to a keyword and return it. Not intended for use on type-names
(mk-field-map {:keys [enum name type display]})
Given the field's values, create the map.
Given the field's values, create the map.
(sort-fields fields)
Take a vector of fields and return them in a vector sorted based on the order to place them in message.
Take a vector of fields and return them in a vector sorted based on the order to place them in message.
(translate-keyword mavlink value)
Translates a keyword to the appropriate enum value if needed
Translates a keyword to the appropriate enum value if needed
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close