func createParamData(){
var message = mavlink_message_t()
var msg : UInt16 = 0
msg = mavlink_msg_param_set_pack(droneManager.systemID, droneManager.compID, &message, drone.systemID, 1, “RTL_RETURN_ALT”, Float(param.flyHeight), UInt8(MAV_PARAM_TYPE_REAL32.rawValue))
let buff: UnsafeMutablePointer<UInt8> = UnsafeMutablePointer.allocate(capacity: Int(msg))
mavlink_msg_to_send_buffer(buff, &message)
let data = Data(bytes: buff, count: Int(msg))
buff.deallocate()
}
网友评论