You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

438 lines
20 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #pragma once
  2. // MESSAGE DIGICAM_CONTROL PACKING
  3. #define MAVLINK_MSG_ID_DIGICAM_CONTROL 155
  4. MAVPACKED(
  5. typedef struct __mavlink_digicam_control_t {
  6. float extra_value; /*< Correspondent value to given extra_param.*/
  7. uint8_t target_system; /*< System ID.*/
  8. uint8_t target_component; /*< Component ID.*/
  9. uint8_t session; /*< 0: stop, 1: start or keep it up //Session control e.g. show/hide lens.*/
  10. uint8_t zoom_pos; /*< 1 to N //Zoom's absolute position (0 means ignore).*/
  11. int8_t zoom_step; /*< -100 to 100 //Zooming step value to offset zoom from the current position.*/
  12. uint8_t focus_lock; /*< 0: unlock focus or keep unlocked, 1: lock focus or keep locked, 3: re-lock focus.*/
  13. uint8_t shot; /*< 0: ignore, 1: shot or start filming.*/
  14. uint8_t command_id; /*< Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once.*/
  15. uint8_t extra_param; /*< Extra parameters enumeration (0 means ignore).*/
  16. }) mavlink_digicam_control_t;
  17. #define MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN 13
  18. #define MAVLINK_MSG_ID_DIGICAM_CONTROL_MIN_LEN 13
  19. #define MAVLINK_MSG_ID_155_LEN 13
  20. #define MAVLINK_MSG_ID_155_MIN_LEN 13
  21. #define MAVLINK_MSG_ID_DIGICAM_CONTROL_CRC 22
  22. #define MAVLINK_MSG_ID_155_CRC 22
  23. #if MAVLINK_COMMAND_24BIT
  24. #define MAVLINK_MESSAGE_INFO_DIGICAM_CONTROL { \
  25. 155, \
  26. "DIGICAM_CONTROL", \
  27. 10, \
  28. { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_digicam_control_t, target_system) }, \
  29. { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_digicam_control_t, target_component) }, \
  30. { "session", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_digicam_control_t, session) }, \
  31. { "zoom_pos", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_digicam_control_t, zoom_pos) }, \
  32. { "zoom_step", NULL, MAVLINK_TYPE_INT8_T, 0, 8, offsetof(mavlink_digicam_control_t, zoom_step) }, \
  33. { "focus_lock", NULL, MAVLINK_TYPE_UINT8_T, 0, 9, offsetof(mavlink_digicam_control_t, focus_lock) }, \
  34. { "shot", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_digicam_control_t, shot) }, \
  35. { "command_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_digicam_control_t, command_id) }, \
  36. { "extra_param", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_digicam_control_t, extra_param) }, \
  37. { "extra_value", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_digicam_control_t, extra_value) }, \
  38. } \
  39. }
  40. #else
  41. #define MAVLINK_MESSAGE_INFO_DIGICAM_CONTROL { \
  42. "DIGICAM_CONTROL", \
  43. 10, \
  44. { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_digicam_control_t, target_system) }, \
  45. { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_digicam_control_t, target_component) }, \
  46. { "session", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_digicam_control_t, session) }, \
  47. { "zoom_pos", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_digicam_control_t, zoom_pos) }, \
  48. { "zoom_step", NULL, MAVLINK_TYPE_INT8_T, 0, 8, offsetof(mavlink_digicam_control_t, zoom_step) }, \
  49. { "focus_lock", NULL, MAVLINK_TYPE_UINT8_T, 0, 9, offsetof(mavlink_digicam_control_t, focus_lock) }, \
  50. { "shot", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_digicam_control_t, shot) }, \
  51. { "command_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_digicam_control_t, command_id) }, \
  52. { "extra_param", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_digicam_control_t, extra_param) }, \
  53. { "extra_value", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_digicam_control_t, extra_value) }, \
  54. } \
  55. }
  56. #endif
  57. /**
  58. * @brief Pack a digicam_control message
  59. * @param system_id ID of this system
  60. * @param component_id ID of this component (e.g. 200 for IMU)
  61. * @param msg The MAVLink message to compress the data into
  62. *
  63. * @param target_system System ID.
  64. * @param target_component Component ID.
  65. * @param session 0: stop, 1: start or keep it up //Session control e.g. show/hide lens.
  66. * @param zoom_pos 1 to N //Zoom's absolute position (0 means ignore).
  67. * @param zoom_step -100 to 100 //Zooming step value to offset zoom from the current position.
  68. * @param focus_lock 0: unlock focus or keep unlocked, 1: lock focus or keep locked, 3: re-lock focus.
  69. * @param shot 0: ignore, 1: shot or start filming.
  70. * @param command_id Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once.
  71. * @param extra_param Extra parameters enumeration (0 means ignore).
  72. * @param extra_value Correspondent value to given extra_param.
  73. * @return length of the message in bytes (excluding serial stream start sign)
  74. */
  75. static inline uint16_t mavlink_msg_digicam_control_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
  76. uint8_t target_system, uint8_t target_component, uint8_t session, uint8_t zoom_pos, int8_t zoom_step, uint8_t focus_lock, uint8_t shot, uint8_t command_id, uint8_t extra_param, float extra_value)
  77. {
  78. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  79. char buf[MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN];
  80. _mav_put_float(buf, 0, extra_value);
  81. _mav_put_uint8_t(buf, 4, target_system);
  82. _mav_put_uint8_t(buf, 5, target_component);
  83. _mav_put_uint8_t(buf, 6, session);
  84. _mav_put_uint8_t(buf, 7, zoom_pos);
  85. _mav_put_int8_t(buf, 8, zoom_step);
  86. _mav_put_uint8_t(buf, 9, focus_lock);
  87. _mav_put_uint8_t(buf, 10, shot);
  88. _mav_put_uint8_t(buf, 11, command_id);
  89. _mav_put_uint8_t(buf, 12, extra_param);
  90. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN);
  91. #else
  92. mavlink_digicam_control_t packet;
  93. packet.extra_value = extra_value;
  94. packet.target_system = target_system;
  95. packet.target_component = target_component;
  96. packet.session = session;
  97. packet.zoom_pos = zoom_pos;
  98. packet.zoom_step = zoom_step;
  99. packet.focus_lock = focus_lock;
  100. packet.shot = shot;
  101. packet.command_id = command_id;
  102. packet.extra_param = extra_param;
  103. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN);
  104. #endif
  105. msg->msgid = MAVLINK_MSG_ID_DIGICAM_CONTROL;
  106. return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DIGICAM_CONTROL_MIN_LEN, MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN, MAVLINK_MSG_ID_DIGICAM_CONTROL_CRC);
  107. }
  108. /**
  109. * @brief Pack a digicam_control message on a channel
  110. * @param system_id ID of this system
  111. * @param component_id ID of this component (e.g. 200 for IMU)
  112. * @param chan The MAVLink channel this message will be sent over
  113. * @param msg The MAVLink message to compress the data into
  114. * @param target_system System ID.
  115. * @param target_component Component ID.
  116. * @param session 0: stop, 1: start or keep it up //Session control e.g. show/hide lens.
  117. * @param zoom_pos 1 to N //Zoom's absolute position (0 means ignore).
  118. * @param zoom_step -100 to 100 //Zooming step value to offset zoom from the current position.
  119. * @param focus_lock 0: unlock focus or keep unlocked, 1: lock focus or keep locked, 3: re-lock focus.
  120. * @param shot 0: ignore, 1: shot or start filming.
  121. * @param command_id Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once.
  122. * @param extra_param Extra parameters enumeration (0 means ignore).
  123. * @param extra_value Correspondent value to given extra_param.
  124. * @return length of the message in bytes (excluding serial stream start sign)
  125. */
  126. static inline uint16_t mavlink_msg_digicam_control_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
  127. mavlink_message_t* msg,
  128. uint8_t target_system,uint8_t target_component,uint8_t session,uint8_t zoom_pos,int8_t zoom_step,uint8_t focus_lock,uint8_t shot,uint8_t command_id,uint8_t extra_param,float extra_value)
  129. {
  130. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  131. char buf[MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN];
  132. _mav_put_float(buf, 0, extra_value);
  133. _mav_put_uint8_t(buf, 4, target_system);
  134. _mav_put_uint8_t(buf, 5, target_component);
  135. _mav_put_uint8_t(buf, 6, session);
  136. _mav_put_uint8_t(buf, 7, zoom_pos);
  137. _mav_put_int8_t(buf, 8, zoom_step);
  138. _mav_put_uint8_t(buf, 9, focus_lock);
  139. _mav_put_uint8_t(buf, 10, shot);
  140. _mav_put_uint8_t(buf, 11, command_id);
  141. _mav_put_uint8_t(buf, 12, extra_param);
  142. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN);
  143. #else
  144. mavlink_digicam_control_t packet;
  145. packet.extra_value = extra_value;
  146. packet.target_system = target_system;
  147. packet.target_component = target_component;
  148. packet.session = session;
  149. packet.zoom_pos = zoom_pos;
  150. packet.zoom_step = zoom_step;
  151. packet.focus_lock = focus_lock;
  152. packet.shot = shot;
  153. packet.command_id = command_id;
  154. packet.extra_param = extra_param;
  155. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN);
  156. #endif
  157. msg->msgid = MAVLINK_MSG_ID_DIGICAM_CONTROL;
  158. return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DIGICAM_CONTROL_MIN_LEN, MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN, MAVLINK_MSG_ID_DIGICAM_CONTROL_CRC);
  159. }
  160. /**
  161. * @brief Encode a digicam_control struct
  162. *
  163. * @param system_id ID of this system
  164. * @param component_id ID of this component (e.g. 200 for IMU)
  165. * @param msg The MAVLink message to compress the data into
  166. * @param digicam_control C-struct to read the message contents from
  167. */
  168. static inline uint16_t mavlink_msg_digicam_control_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_digicam_control_t* digicam_control)
  169. {
  170. return mavlink_msg_digicam_control_pack(system_id, component_id, msg, digicam_control->target_system, digicam_control->target_component, digicam_control->session, digicam_control->zoom_pos, digicam_control->zoom_step, digicam_control->focus_lock, digicam_control->shot, digicam_control->command_id, digicam_control->extra_param, digicam_control->extra_value);
  171. }
  172. /**
  173. * @brief Encode a digicam_control struct on a channel
  174. *
  175. * @param system_id ID of this system
  176. * @param component_id ID of this component (e.g. 200 for IMU)
  177. * @param chan The MAVLink channel this message will be sent over
  178. * @param msg The MAVLink message to compress the data into
  179. * @param digicam_control C-struct to read the message contents from
  180. */
  181. static inline uint16_t mavlink_msg_digicam_control_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_digicam_control_t* digicam_control)
  182. {
  183. return mavlink_msg_digicam_control_pack_chan(system_id, component_id, chan, msg, digicam_control->target_system, digicam_control->target_component, digicam_control->session, digicam_control->zoom_pos, digicam_control->zoom_step, digicam_control->focus_lock, digicam_control->shot, digicam_control->command_id, digicam_control->extra_param, digicam_control->extra_value);
  184. }
  185. /**
  186. * @brief Send a digicam_control message
  187. * @param chan MAVLink channel to send the message
  188. *
  189. * @param target_system System ID.
  190. * @param target_component Component ID.
  191. * @param session 0: stop, 1: start or keep it up //Session control e.g. show/hide lens.
  192. * @param zoom_pos 1 to N //Zoom's absolute position (0 means ignore).
  193. * @param zoom_step -100 to 100 //Zooming step value to offset zoom from the current position.
  194. * @param focus_lock 0: unlock focus or keep unlocked, 1: lock focus or keep locked, 3: re-lock focus.
  195. * @param shot 0: ignore, 1: shot or start filming.
  196. * @param command_id Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once.
  197. * @param extra_param Extra parameters enumeration (0 means ignore).
  198. * @param extra_value Correspondent value to given extra_param.
  199. */
  200. #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
  201. static inline void mavlink_msg_digicam_control_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t session, uint8_t zoom_pos, int8_t zoom_step, uint8_t focus_lock, uint8_t shot, uint8_t command_id, uint8_t extra_param, float extra_value)
  202. {
  203. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  204. char buf[MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN];
  205. _mav_put_float(buf, 0, extra_value);
  206. _mav_put_uint8_t(buf, 4, target_system);
  207. _mav_put_uint8_t(buf, 5, target_component);
  208. _mav_put_uint8_t(buf, 6, session);
  209. _mav_put_uint8_t(buf, 7, zoom_pos);
  210. _mav_put_int8_t(buf, 8, zoom_step);
  211. _mav_put_uint8_t(buf, 9, focus_lock);
  212. _mav_put_uint8_t(buf, 10, shot);
  213. _mav_put_uint8_t(buf, 11, command_id);
  214. _mav_put_uint8_t(buf, 12, extra_param);
  215. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIGICAM_CONTROL, buf, MAVLINK_MSG_ID_DIGICAM_CONTROL_MIN_LEN, MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN, MAVLINK_MSG_ID_DIGICAM_CONTROL_CRC);
  216. #else
  217. mavlink_digicam_control_t packet;
  218. packet.extra_value = extra_value;
  219. packet.target_system = target_system;
  220. packet.target_component = target_component;
  221. packet.session = session;
  222. packet.zoom_pos = zoom_pos;
  223. packet.zoom_step = zoom_step;
  224. packet.focus_lock = focus_lock;
  225. packet.shot = shot;
  226. packet.command_id = command_id;
  227. packet.extra_param = extra_param;
  228. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIGICAM_CONTROL, (const char *)&packet, MAVLINK_MSG_ID_DIGICAM_CONTROL_MIN_LEN, MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN, MAVLINK_MSG_ID_DIGICAM_CONTROL_CRC);
  229. #endif
  230. }
  231. /**
  232. * @brief Send a digicam_control message
  233. * @param chan MAVLink channel to send the message
  234. * @param struct The MAVLink struct to serialize
  235. */
  236. static inline void mavlink_msg_digicam_control_send_struct(mavlink_channel_t chan, const mavlink_digicam_control_t* digicam_control)
  237. {
  238. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  239. mavlink_msg_digicam_control_send(chan, digicam_control->target_system, digicam_control->target_component, digicam_control->session, digicam_control->zoom_pos, digicam_control->zoom_step, digicam_control->focus_lock, digicam_control->shot, digicam_control->command_id, digicam_control->extra_param, digicam_control->extra_value);
  240. #else
  241. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIGICAM_CONTROL, (const char *)digicam_control, MAVLINK_MSG_ID_DIGICAM_CONTROL_MIN_LEN, MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN, MAVLINK_MSG_ID_DIGICAM_CONTROL_CRC);
  242. #endif
  243. }
  244. #if MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN <= MAVLINK_MAX_PAYLOAD_LEN
  245. /*
  246. This varient of _send() can be used to save stack space by re-using
  247. memory from the receive buffer. The caller provides a
  248. mavlink_message_t which is the size of a full mavlink message. This
  249. is usually the receive buffer for the channel, and allows a reply to an
  250. incoming message with minimum stack space usage.
  251. */
  252. static inline void mavlink_msg_digicam_control_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t session, uint8_t zoom_pos, int8_t zoom_step, uint8_t focus_lock, uint8_t shot, uint8_t command_id, uint8_t extra_param, float extra_value)
  253. {
  254. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  255. char *buf = (char *)msgbuf;
  256. _mav_put_float(buf, 0, extra_value);
  257. _mav_put_uint8_t(buf, 4, target_system);
  258. _mav_put_uint8_t(buf, 5, target_component);
  259. _mav_put_uint8_t(buf, 6, session);
  260. _mav_put_uint8_t(buf, 7, zoom_pos);
  261. _mav_put_int8_t(buf, 8, zoom_step);
  262. _mav_put_uint8_t(buf, 9, focus_lock);
  263. _mav_put_uint8_t(buf, 10, shot);
  264. _mav_put_uint8_t(buf, 11, command_id);
  265. _mav_put_uint8_t(buf, 12, extra_param);
  266. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIGICAM_CONTROL, buf, MAVLINK_MSG_ID_DIGICAM_CONTROL_MIN_LEN, MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN, MAVLINK_MSG_ID_DIGICAM_CONTROL_CRC);
  267. #else
  268. mavlink_digicam_control_t *packet = (mavlink_digicam_control_t *)msgbuf;
  269. packet->extra_value = extra_value;
  270. packet->target_system = target_system;
  271. packet->target_component = target_component;
  272. packet->session = session;
  273. packet->zoom_pos = zoom_pos;
  274. packet->zoom_step = zoom_step;
  275. packet->focus_lock = focus_lock;
  276. packet->shot = shot;
  277. packet->command_id = command_id;
  278. packet->extra_param = extra_param;
  279. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIGICAM_CONTROL, (const char *)packet, MAVLINK_MSG_ID_DIGICAM_CONTROL_MIN_LEN, MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN, MAVLINK_MSG_ID_DIGICAM_CONTROL_CRC);
  280. #endif
  281. }
  282. #endif
  283. #endif
  284. // MESSAGE DIGICAM_CONTROL UNPACKING
  285. /**
  286. * @brief Get field target_system from digicam_control message
  287. *
  288. * @return System ID.
  289. */
  290. static inline uint8_t mavlink_msg_digicam_control_get_target_system(const mavlink_message_t* msg)
  291. {
  292. return _MAV_RETURN_uint8_t(msg, 4);
  293. }
  294. /**
  295. * @brief Get field target_component from digicam_control message
  296. *
  297. * @return Component ID.
  298. */
  299. static inline uint8_t mavlink_msg_digicam_control_get_target_component(const mavlink_message_t* msg)
  300. {
  301. return _MAV_RETURN_uint8_t(msg, 5);
  302. }
  303. /**
  304. * @brief Get field session from digicam_control message
  305. *
  306. * @return 0: stop, 1: start or keep it up //Session control e.g. show/hide lens.
  307. */
  308. static inline uint8_t mavlink_msg_digicam_control_get_session(const mavlink_message_t* msg)
  309. {
  310. return _MAV_RETURN_uint8_t(msg, 6);
  311. }
  312. /**
  313. * @brief Get field zoom_pos from digicam_control message
  314. *
  315. * @return 1 to N //Zoom's absolute position (0 means ignore).
  316. */
  317. static inline uint8_t mavlink_msg_digicam_control_get_zoom_pos(const mavlink_message_t* msg)
  318. {
  319. return _MAV_RETURN_uint8_t(msg, 7);
  320. }
  321. /**
  322. * @brief Get field zoom_step from digicam_control message
  323. *
  324. * @return -100 to 100 //Zooming step value to offset zoom from the current position.
  325. */
  326. static inline int8_t mavlink_msg_digicam_control_get_zoom_step(const mavlink_message_t* msg)
  327. {
  328. return _MAV_RETURN_int8_t(msg, 8);
  329. }
  330. /**
  331. * @brief Get field focus_lock from digicam_control message
  332. *
  333. * @return 0: unlock focus or keep unlocked, 1: lock focus or keep locked, 3: re-lock focus.
  334. */
  335. static inline uint8_t mavlink_msg_digicam_control_get_focus_lock(const mavlink_message_t* msg)
  336. {
  337. return _MAV_RETURN_uint8_t(msg, 9);
  338. }
  339. /**
  340. * @brief Get field shot from digicam_control message
  341. *
  342. * @return 0: ignore, 1: shot or start filming.
  343. */
  344. static inline uint8_t mavlink_msg_digicam_control_get_shot(const mavlink_message_t* msg)
  345. {
  346. return _MAV_RETURN_uint8_t(msg, 10);
  347. }
  348. /**
  349. * @brief Get field command_id from digicam_control message
  350. *
  351. * @return Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once.
  352. */
  353. static inline uint8_t mavlink_msg_digicam_control_get_command_id(const mavlink_message_t* msg)
  354. {
  355. return _MAV_RETURN_uint8_t(msg, 11);
  356. }
  357. /**
  358. * @brief Get field extra_param from digicam_control message
  359. *
  360. * @return Extra parameters enumeration (0 means ignore).
  361. */
  362. static inline uint8_t mavlink_msg_digicam_control_get_extra_param(const mavlink_message_t* msg)
  363. {
  364. return _MAV_RETURN_uint8_t(msg, 12);
  365. }
  366. /**
  367. * @brief Get field extra_value from digicam_control message
  368. *
  369. * @return Correspondent value to given extra_param.
  370. */
  371. static inline float mavlink_msg_digicam_control_get_extra_value(const mavlink_message_t* msg)
  372. {
  373. return _MAV_RETURN_float(msg, 0);
  374. }
  375. /**
  376. * @brief Decode a digicam_control message into a struct
  377. *
  378. * @param msg The message to decode
  379. * @param digicam_control C-struct to decode the message contents into
  380. */
  381. static inline void mavlink_msg_digicam_control_decode(const mavlink_message_t* msg, mavlink_digicam_control_t* digicam_control)
  382. {
  383. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  384. digicam_control->extra_value = mavlink_msg_digicam_control_get_extra_value(msg);
  385. digicam_control->target_system = mavlink_msg_digicam_control_get_target_system(msg);
  386. digicam_control->target_component = mavlink_msg_digicam_control_get_target_component(msg);
  387. digicam_control->session = mavlink_msg_digicam_control_get_session(msg);
  388. digicam_control->zoom_pos = mavlink_msg_digicam_control_get_zoom_pos(msg);
  389. digicam_control->zoom_step = mavlink_msg_digicam_control_get_zoom_step(msg);
  390. digicam_control->focus_lock = mavlink_msg_digicam_control_get_focus_lock(msg);
  391. digicam_control->shot = mavlink_msg_digicam_control_get_shot(msg);
  392. digicam_control->command_id = mavlink_msg_digicam_control_get_command_id(msg);
  393. digicam_control->extra_param = mavlink_msg_digicam_control_get_extra_param(msg);
  394. #else
  395. uint8_t len = msg->len < MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN? msg->len : MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN;
  396. memset(digicam_control, 0, MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN);
  397. memcpy(digicam_control, _MAV_PAYLOAD(msg), len);
  398. #endif
  399. }