DataType

데이터 타입을 소개합니다.

namespace Protocol
{
    namespace DataType
    {
        enum Type
        {
            None                        = 0x00,     // 없음
            Ping                        = 0x01,     // 통신 확인
            Ack                         = 0x02,     // 데이터 수신에 대한 응답
            Error                       = 0x03,     // 오류(reserve, 비트 플래그는 추후에 지정)
            Request                     = 0x04,     // 지정한 타입의 데이터 요청
            Message                     = 0x05,     // 문자열 데이터
            Address                     = 0x06,     // 장치 주소(MAC이 있는 경우 MAC) 혹은 고유번호(MAC이 없는 경우 UUID)
            Information                 = 0x07,     // 펌웨어 및 장치 정보
            Update                      = 0x08,     // 펌웨어 업데이트
            UpdateLocation              = 0x09,     // 펌웨어 업데이트 위치 정정
            Encrypt                     = 0x0A,     // 펌웨어 암호화
            SystemCount                 = 0x0B,     // 시스템 카운트
            SystemInformation           = 0x0C,     // 시스템 정보
            Registration                = 0x0D,     // 제품 등록(암호화 데이터 및 등록 데이터를 데이터 길이로 구분)
            Administrator               = 0x0E,     // 관리자 권한 획득
            Monitor                     = 0x0F,     // 디버깅용 값 배열 전송. 첫번째 바이트에 타입, 두 번째 바이트에 페이지 지정(수신 받는 데이터의 저장 경로 구분)
            Control                     = 0x10,     // 조종

            Command                     = 0x11,     // 명령
            Pairing                     = 0x12,     // 페어링
            Rssi                        = 0x13,     // RSSI
            TimeSync                    = 0x14,     // 시간 동기화
            TransmissionPower           = 0x15,     // 전송 출력
            Setup                       = 0x16,     // 설정

            // Light
            LightManual                 = 0x20,     // LED 수동 제어
            LightMode                   = 0x21,     // LED 모드 지정
            LightEvent                  = 0x22,     // LED 이벤트
            LightDefault                = 0x23,     // LED 기본 색상

            // 센서 RAW 데이터
            RawMotion                   = 0x30,     // Motion 센서 데이터 RAW 값
            RawFlow,                                // Flow 센서 데이터 RAW 값

            // 상태,  센서
            State                       = 0x40,     // 드론의 상태(비행 모드, 방위기준, 배터리량)
            Attitude,                               // 드론의 자세(Angle)(Attitude)
            Position,                               // 위치
            Altitude,                               // 높이, 고도
            Motion,                                 // Motion 센서 데이터 처리한 값(IMU)
            Range,                                  // 거리센서 데이터

            // 설정
            Count                       = 0x50,     // 카운트
            Bias,                                   // 엑셀, 자이로 바이어스 값
            Trim,                                   // 트림
            Weight,                                 // 무게 설정
            LostConnection,                         // 연결이 끊긴 후 반응 시간 설정

            // Devices
            Motor                       = 0x60,     // 모터 제어 및 현재 제어값 확인
            MotorSingle,                            // 한 개의 모터 제어
            Buzzer,                                 // 부저 제어
            Vibrator,                               // 진동 제어

            // Input
            Button                      = 0x70,     // 버튼 입력
            Joystick,                               // 조이스틱 입력
            
            // Display
            DisplayClear                = 0x80,     // 화면 지우기
            DisplayInvert,                          // 화면 반전
            DisplayDrawPoint,                       // 점 그리기
            DisplayDrawLine,                        // 선 그리기
            DisplayDrawRect,                        // 사각형 그리기
            DisplayDrawCircle,                      // 원 그리기
            DisplayDrawString,                      // 문자열 쓰기
            DisplayDrawStringAlign,                 // 문자열 쓰기
            DisplayDrawImage,                       // 그림 그리기

            // Card
            CardClassify                = 0x90,     // 카드 색상 분류 기준 설정
            CardRange,                              // 카드 색 범위(RAW 데이터의 출력 범위)
            CardRaw,                                // 카드 데이터 RAW 값(유선으로만 전송)
            CardColor,                              // 카드 데이터
            CardList,                               // 카드 리스트 데이터
            CardFunctionList,                       // 카드 함수 리스트 데이터
            CardClassifyRaw,                        // 카드 색상 분류(Raw)
            
            // Information Assembled
            InformationAssembledForController       = 0xA0,     // 데이터 모음
            InformationAssembledForEntry            = 0xA1,     // 데이터 모음
            InformationAssembledForByBlocks         = 0xA2,     // 데이터 모음
            
            EndOfType
        };
    }
}

아래는 각 DataType와 연관된 구조체들입니다.

이름

값.

대상.

설명.

구조

None

0x00

-

없음

Ping

0x01

A

통신 확인.

Protocol::Ping

Ack

0x02

A

데이터 수신에 대한 응답.

Protocol::Ack

Error

0x03

A

오류.

Protocol::Error

Request

0x04

A

지정한 타입의 데이터 요청

Protocol::Request

Message

0x05

-

문자열 데이터

Address

0x06

A

주소.

Protocol::Address

Information

0x07

A

펌웨어 및 장치 정보

Protocol::Information

Update

0x08

A

펌웨어 업데이트.

UpdateLocation

0x09

A

펌웨어 업데이트 위치

Encrypt

0x0A

A

펌웨어 암호화.

SystemCount

0x0B

A

시스템 카운터.

SystemInformation

0x0C

A

시스템 정보.

Registration

0x0D

-

제품 등록.

Administrator

0x0E

-

관리자.

Monitor

0x0F

-

디버깅 데이터.

Control

0x10

D

조종

Control::Quad8, Control::Quad8AndRequestData, Control::Position

Command

0x11

A

명령.

Protocol::Command::Command, Protocol::Command::LightEvent, Protocol::Command::LightEventColor, Protocol::Command::LightEventColors

Pairing

0x12

A

페어링.

Protocol::Pairing

Rssi

0x13

A

RSSI

Protocol::Rssi

TimeSync

0x14

A

TimeSync

TransmissionPower

0x15

A

RF 데이터 송신 세기.

Setup

0x16

D

드론 제어기 설정 값.

LightManual

0x20

A

LED 수동 제어.

Protocol::Light::Manual

LightMode

0x21

D

LED 모드 지정.

Protocol::Light::Mode, Protocol::Light::ModeColor, Protocol::Light::ModeColors

LightEvent

0x22

D

LED 이벤트.

Protocol::Light::Event, Protocol::Light::EventColor, Protocol::Light::EventColors

LightDefault

0x23

D

LED 초기색.

Protocol::Light::ModeColor, Protocol::Light::ModeColors

RawMotion

0x30

D

Motion Raw 데이터(Accel, Gyro)

Protocol::RawMotion

RawFlow

0x31

D

Flow Raw 데이터.

Protocol::RawFlow

State

0x40

D

장치의 상태

Protocol::StateProtocol::StateController, Protocol::StateLink

Attitude

0x41

D

드론의 자세(Angle)

Protocol::Attitude

Position

0x42

D

위치.

Protocol::Position

Altitude

0x43

D

높이, 고도.

Protocol::Altitude

Motion

0x44

D

Motion 센서(Accel, Gyro, Angle)

Protocol::Motion

Range

0x45

D

Range 센서.

Protocol::Range

Count

0x50

D

카운트.

Protocol::Count

Bias

0x51

D

Accel, Gyro 바이어스 값.

Protocol::Bias

Trim

0x52

D

Trim

Protocol::Trim

Weight

0x53

D

무게.

Protocol::Weight

LostConnection

0x54

D

연결이 끊긴 후 반응 시간 설정

Protocol::LostConnection

Motor

0x60

D

모터 제어 및 현재 제어값 확인

Protocol::Motor

MotorSingle

0x61

D

한 개의 모터 제어

Protocol::MotorSingle

Buzzer

0x62

C

버저 제어.

Protocol::Buzzer, Protocol::BuzzerMelody

Vibrator

0x63

C

진동 제어.

Protocol::Vibrator

Button

0x70

A

버튼 입력

Protocol::Button

Joystick

0x71

C

조이스틱 입력

Protocol::Joystick

DisplayClear

0x80

C

화면 지우기

Protocol::Display::ClearAll, Protocol::Display::Clear

DisplayInvert

0x81

C

화면 반전.

Protocol::Display::Invert

DisplayDrawPoint

0x82

C

점 그리기.

Protocol::Display::DrawPoint

DisplayDrawLine

0x83

C

선 그리기.

Protocol::Display::DrawLine

DisplayDrawRect

0x84

C

사각형 그리기.

Protocol::Display::DrawRect

DisplayDrawCircle

0x85

C

원 그리기.

Protocol::Display::DrawCircle

DisplayDrawString

0x86

C

문자열 쓰기

Protocol::Display::DrawString

DisplayDrawStringAlign

0x87

C

문자열 정렬하여 쓰기

Protocol::Display::DrawStringAlign

DisplayDrawImage

0x88

C

이미지 그리기.

Protocol::Display::DrawImage

CardClassify

0x90

D

카드 색상 분류 기준 설정.

Protocol::Card::Classify

CardRange

0x91

D

카드 색 범위(RAW 데이터의 출력 범위)

Protocol::Card::Range

CardRaw

0x92

D

카드 데이터 RAW 값(유선으로만 전송)

Protocol::Card::Raw

CardColor

0x93

D

카드 데이터

Protocol::Card::Color

CardList

0x94

D

카드 리스트 데이터

Protocol::Card::List

CardFunctionList

0x95

D

카드 함수 리스트 데이터

Protocol::Card::FunctionList

InformationAssembledForController

0xA0

D

자주 갱신되는 데이터 모음(조종기)

Protocol::InformationAssembledForController

InformationAssembledForEntry

0xA1

D

자주 갱신되는 데이터 모음(엔트리)

Protocol::InformationAssembledForEntry

InformationAssembledForByBlocks

0xA2

D

자주 갱신되는 데이터 모음(바이블럭)

Protocol::InformationAssembledForByBlocks

  • A: 모든 장치(All)

  • C: 조종기(Controller)

  • D: 드론(Drone)

Last updated