I am trying a custom gcs written in swift using the Mavlink c library.I can manage to send the request data stream command, but I can't seem to get command_long workingHere is an example for sending the arm command.func sendData(){var message = mavlink_message_t()mavlink_msg_command_long_pack(255, 0, &message, 1, 0, 400, 0, 1, 0, 0, 0, 0, 0, 0)let length = Int(mavlink_msg_get_send_buffer_length(&message))var bytes = [UInt8](count:length, repeatedValue: 0)mavlink_msg_to_send_buffer(&bytes, &message)let sendData = NSData(bytes: (bytes as [UInt8]), length: length)bluetooth.write(sendData)}Also when sending the command for requesting data stream, I have to add 1 to get the correct data, eg to get sys_status stream I use Id of 2 not 1.Thanks
You need to be a member of diydrones to add comments!
Replies