E-DRIVE / Protocol / DataType

Modified : 2020.1.13


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



Protocol::DataType::Type

데이터 타입

namespace Protocol
{
    namespace DataType
    {
        enum Type
        {
            None                        = 0x00,     // 없음
            Ping                        = 0x01,     // 통신 확인
            Ack                         = 0x02,     // 데이터 수신에 대한 응답
            Error                       = 0x03,     // 오류
            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,     // 명령
            
            // Light
            LightManual                 = 0x20,     // LED 수동 제어
            LightMode                   = 0x21,     // LED 모드 지정
            LightEvent                  = 0x22,     // LED 이벤트
            LightDefault                = 0x23,     // LED 기본 색상
            
            // 센서 RAW 데이터
            RawMotion                   = 0x30,     // Motion 센서 데이터 RAW 값
            RawLineTracer,                          // 라인트레이서 데이터 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,                               // 조이스틱 입력(자동차에서는 사용하지 않음)
            
            // Card
            CardClassify                = 0x90,     // 카드 색상 분류(+Margin)
            CardRange,                              // 카드 색 범위(RAW 데이터의 출력 범위)
            CardRaw,                                // 카드 데이터 RAW 값(유선으로만 전송)
            CardColor,                              // 카드 데이터
            CardList,                               // 카드 리스트 데이터
            CardFunctionList,                       // 카드 함수 리스트 데이터
            CardClassifyRaw,                        // 카드 색상 분류(Raw)
            
            // HandFollowing
            HandFollowingSetup          = 0x9A,     // 핸드팔로잉 설정
            
            // Information Assembled
            InformationAssembledForController       = 0xA0,     // 데이터 모음
            InformationAssembledForEntry            = 0xA1,     // 데이터 모음
            InformationAssembledForByBlocks         = 0xA2,     // 데이터 모음
            
            // LINK 모듈
            LinkState                               = 0xE0,     // 링크 모듈의 상태
            LinkEvent,                                          // 링크 모듈의 이벤트
            LinkEventAddress,                                   // 링크 모듈의 이벤트 + 주소
            LinkRssi,                                           // 링크와 연결된 장치의 RSSI값
            LinkDiscoveredDevice,                               // 검색된 장치
            LinkPasscode,                                       // 페어링 시 필요한 Passcode 설정
            
            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 C 조종 Control::Quad8,
Control::Quad8AndRequestData,
Control::PositionDriveMove,
Control::PositionDriveHeading
Command 0x11 A 명령 Protocol::Command::Command,
Protocol::Command::LightEvent,
Protocol::Command::LightEventColor,
Protocol::Command::LightEventColors
LightManual 0x20 A LED 수동 제어 Protocol::Light::Manual
LightMode 0x21 C LED 모드 지정 Protocol::Light::Mode,
Protocol::Light::ModeColor,
Protocol::Light::ModeColors
LightEvent 0x22 C LED 이벤트 Protocol::Light::Event,
Protocol::Light::EventColor,
Protocol::Light::EventColors
LightDefault 0x23 C LED 초기색 Protocol::Light::ModeColor,
Protocol::Light::ModeColors
RawMotion 0x30 C Motion Raw 데이터(Accel, Gyro) Protocol::RawMotion
RawLineTracer 0x31 C 라인트레이서 데이터 RAW 값 Protocol::RawLineTracer
State 0x40 C 드론의 상태 Protocol::State
Attitude 0x41 C 드론의 자세(Angle) Protocol::Attitude
Position 0x42 C 위치 Protocol::Position
Motion 0x43 C Motion 센서(Accel, Gyro, Angle) Protocol::Motion
Range 0x44 C Range 센서 Protocol::Range
Count 0x50 C 카운트 Protocol::Count
Bias 0x51 C Accel, Gyro 바이어스 값 Protocol::Bias
Trim 0x52 C Trim Protocol::Trim
Motor 0x60 C 모터 제어 및 현재 제어값 확인 Protocol::Motor
MotorSingle 0x61 C 한 개의 모터 제어 Protocol::MotorSingle
Buzzer 0x62 C 버저 제어 Protocol::Buzzer,
Protocol::BuzzerMelody
Button 0x70 A 버튼 입력 Protocol::Button
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
CardClassifyRaw 0x96 D 카드 색상 분류(Raw) Protocol::Card::Classify
HandFollowingSetup 0x9A D 핸드팔로잉 설정 -
InformationAssembledForController 0xA0 C 자주 갱신되는 데이터 모음(조종기) Protocol::InformationAssembledForController
InformationAssembledForEntry 0xA1 C 자주 갱신되는 데이터 모음(엔트리) Protocol::InformationAssembledForEntry
InformationAssembledForByBlocks 0xA2 C 자주 갱신되는 데이터 모음(바이블럭) Protocol::InformationAssembledForByBlocks
LinkState 0xE0 B 링크 모듈의 상태 Protocol::LinkState
LinkEvent 0xE1 B 링크 모듈의 이벤트 Protocol::LinkEvent
LinkEventAddress 0xE2 B 링크 모듈의 이벤트 + 주소 Protocol::LinkEventAddress
LinkRssi 0xE3 B 링크와 연결된 장치의 RSSI값 Protocol::LinkRssi
LinkDiscoveredDevice 0xE4 B 검색된 장치 Protocol::LinkDiscoveredDevice
LinkPasscode 0xE5 B 페어링 시 필요한 Passcode 설정 Protocol::LinkPasscode


  • A: 모든 장치(All)
  • B: 블루투스 모듈(Bluetooth)
  • C: 자동차(Car)



E-DRIVE

  1. Intro
  2. Typedef
  3. DataType
  4. Definitions
  5. Structs
  6. Structs - Light
  7. Structs - Card


Index