PETRONE_V2 / Protocol / DataType
Modified : 2018.3.6
데이터 타입을 소개합니다.
Protocol::DataType::Type
데이터 타입
namespace Protocol
{
namespace DataType
{
enum Type
{
None = 0x00, // 없음
Ping = 0x01, // 통신 확인
Ack = 0x02, // 데이터 수신에 대한 응답
Error = 0x03, // 오류
Request = 0x04, // 지정한 타입의 데이터 요청
Message = 0x05, // 문자열 데이터
Reserved_1 = 0x06, // 예약
Reserved_2 = 0x07, // 예약
Monitor = 0x08, // 디버깅용 값 배열 전송
SystemCounter = 0x09, // 시스템 카운터
Information = 0x0A, // 펌웨어 및 장치 정보
UpdateLocation = 0x0B, // 펌웨어 업데이트 위치 정정
Update = 0x0C, // 펌웨어 업데이트
Encrypt = 0x0D, // 펌웨어 암호화
Address = 0x0E, // 장치 주소
Administrator = 0x0F, // 관리자 권한 획득
Control = 0x10, // 조종 명령
Command = 0x11, // 명령
// Light
LightManual = 0x20, // LED 수동 제어
LightMode = 0x21, // LED 모드
LightModeCommand = 0x22, // LED 모드, 커맨드
LightModeCommandIr = 0x23, // LED 모드, 커맨드, IR
LightModeColor = 0x24, // LED 모드 3색
LightModeColorCommand = 0x25, // LED 모드 3색, 커맨드
LightModeColorCommandIr = 0x26, // LED 모드 3색, 커맨드, IR
LightModeColors = 0x27, // LED 모드 팔레트
LightModeColorsCommand = 0x28, // LED 모드 팔레트, 커맨드
LightModeColorsCommandIr = 0x29, // LED 모드 팔레트, 커맨드, IR
LightEvent = 0x2A, // LED 이벤트
LightEventCommand = 0x2B, // LED 이벤트, 커맨드
LightEventCommandIr = 0x2C, // LED 이벤트, 커맨드, IR
LightEventColor = 0x2D, // LED 이벤트 3색
LightEventColorCommand = 0x2E, // LED 이벤트 3색, 커맨드
LightEventColorCommandIr = 0x2F, // LED 이벤트 3색, 커맨드, IR
LightEventColors = 0x30, // LED 이벤트 팔레트
LightEventColorsCommand = 0x31, // LED 이벤트 팔레트, 커맨드
LightEventColorsCommandIr = 0x32, // LED 이벤트 팔레트, 커맨드, IR
LightModeDefaultColor = 0x33, // LED 초기 모드 3색
// 상태, 설정
State = 0x40, // 드론의 상태
Attitude, // 드론의 자세
AccelBias, // 엑셀 바이어스 값(Vector)
GyroBias, // 자이로 바이어스 값
TrimAll, // 전체 트림
TrimFlight, // 비행 트림
TrimDrive, // 주행 트림
// Sensor raw data
Imu = 0x50, // IMU Raw
Pressure, // 압력 센서 데이터
Battery, // 배터리
Range, // 거리 센서
ImageFlow, // ImageFlow
CameraImage, // CameraImage
// Input
Button = 0x70, // 버튼 입력
Joystick, // 조이스틱 입력
// Devices
Motor = 0x80, // 모터 제어 및 현재 제어값 확인
MotorSingle, // 한 개의 모터 제어
IrMessage, // IR 데이터 송수신
Buzzer, // 부저 제어
Vibrator, // 진동 제어
// 카운트
CountFlight = 0x90, // 비행 관련 카운트
CountDrive, // 주행 관련 카운트
// RF
Pairing = 0xA0, // 페어링
Rssi, // RSSI
// Display
DisplayClear = 0xB0, // 화면 지우기
DisplayInvert, // 화면 반전
DisplayDrawPoint, // 점 그리기
DisplayDrawLine, // 선 그리기
DisplayDrawRect, // 사각형 그리기
DisplayDrawCircle, // 원 그리기
DisplayDrawString, // 문자열 쓰기
DisplayDrawStringAlign, // 문자열 정렬하여 쓰기
// Information Assembled
InformationAssembledForController = 0xD0, // 자주 갱신되는 데이터 모음(조종기)
InformationAssembledForEntry = 0xD1, // 자주 갱신되는 데이터 모음(드론)
EndOfType
};
}
}
아래는 각 DataType와 연관된 구조체들을 링크로 연결해두었습니다.
이름 | 값 | 대상 | 설명 | 구조체 |
---|---|---|---|---|
None | 0x00 | - | 없음 | |
Ping | 0x01 | A | 통신 확인 | Protocol::Ping |
Ack | 0x02 | A | 데이터 수신에 대한 응답 | Protocol::Ack |
Error | 0x03 | - | 오류(reserve, 비트 플래그는 추후에 지정) | Protocol::Error |
Request | 0x04 | A | 지정한 타입의 데이터 요청 | Protocol::Request |
Message | 0x05 | - | 문자열 데이터 | |
Reserved_1 | 0x06 | - | 예약 | |
Reserved_2 | 0x07 | - | 예약 | |
Monitor | 0x08 | D | 디버깅용 값 배열 전송 | |
SystemCounter | 0x09 | A | 시스템 카운터 | |
Information | 0x0A | A | 펌웨어 및 장치 정보 | Protocol::Information |
UpdateLocation | 0x0B | A | 펌웨어 업데이트 위치 정정 | |
Update | 0x0C | A | 펌웨어 업데이트 | |
Encrypt | 0x0D | - | 펌웨어 암호화 | |
Address | 0x0E | A | 장치 주소 | Protocol::Address |
Administrator | 0x0F | - | 관리자 권한 | |
Control | 0x10 | D | 조종 명령 | Control::Double8, Control::Quad8 |
Command | 0x11 | A | 명령 | Protocol::Command |
LightManual | 0x20 | A | LED 수동 제어 | Protocol::Light::Manual |
LightMode | 0x21 | - | LED 모드 지정 | Protocol::Light::Mode |
LightModeCommand | 0x22 | - | LED 모드, 커맨드 | Protocol::Light::ModeCommand |
LightModeCommandIr | 0x23 | - | LED 모드, 커맨드, IR | Protocol::Light::ModeCommandIr |
LightModeColor | 0x24 | A | LED 모드 3색 | Protocol::Light::ModeColor |
LightModeColorCommand | 0x25 | A | LED 모드 3색, 커맨드 | Protocol::Light::ModeColorCommand |
LightModeColorCommandIr | 0x26 | A | LED 모드 3색, 커맨드, IR | Protocol::Light::ModeColorCommandIr |
LightModeColors | 0x27 | A | LED 모드 팔레트 | Protocol::Light::ModeColors |
LightModeColorsCommand | 0x28 | A | LED 모드 팔레트, 커맨드 | Protocol::Light::ModeColorsCommand |
LightModeColorsCommandIr | 0x29 | A | LED 모드 팔레트, 커맨드, IR | Protocol::Light::ModeColorsCommandIr |
LightEvent | 0x2A | - | LED 이벤트 | Protocol::Light::Event |
LightEventCommand | 0x2B | - | LED 이벤트, 커맨드 | Protocol::Light::EventCommand |
LightEventCommandIr | 0x2C | - | LED 이벤트, 커맨드, IR | Protocol::Light::EventCommandIr |
LightEventColor | 0x2D | A | LED 이벤트 3색 | Protocol::Light::EventColor |
LightEventColorCommand | 0x2E | A | LED 이벤트 3색, 커맨드 | Protocol::Light::EventColorCommand |
LightEventColorCommandIr | 0x2F | A | LED 이벤트 3색, 커맨드, IR | Protocol::Light::EventColorCommandIr |
LightEventColors | 0x30 | A | LED 이벤트 팔레트 | Protocol::Light::EventColors |
LightEventColorsCommand | 0x31 | A | LED 이벤트 팔레트, 커맨드 | Protocol::Light::EventColorsCommand |
LightEventColorsCommandIr | 0x32 | A | LED 이벤트 팔레트, 커맨드, IR | Protocol::Light::EventColorsCommandIr |
LightModeDefaultColor | 0x33 | D | LED 초기 모드 3색 | Protocol::Light::ModeColor |
State | 0x40 | D | 드론의 상태 | Protocol::State |
Attitude | 0x41 | D | 드론의 자세(Angle) | Protocol::Attitude |
AccelBias | 0x42 | D | Accel 바이어스 값 | Protocol::AccelBias |
GyroBias | 0x43 | D | Gyro 바이어스 값 | Protocol::GyroBias |
TrimAll | 0x44 | D | 전체 트림 | Protocol::TrimAll |
TrimFlight | 0x45 | D | 비행 트림 | Protocol::TrimFlight |
TrimDrive | 0x46 | D | 주행 트림 | Protocol::TrimDrive |
Imu | 0x50 | D | IMU(Accel, Gyro, Angle) | Protocol::Imu |
Pressure | 0x51 | D | 압력 센서 데이터 | Protocol::Pressure |
Battery | 0x52 | D | 배터리 | Protocol::Battery |
Range | 0x53 | D | 거리 센서 | Protocol::Range |
ImageFlow | 0x54 | D | ImageFlow | Protocol::ImageFlow |
CameraImage | 0x55 | D | CameraImage | |
Button | 0x70 | A | 버튼 입력 | Protocol::Button |
Joystick | 0x71 | C | 조이스틱 입력 | Protocol::Joystick |
Motor | 0x80 | D | 모터 제어 및 현재 제어값 확인 | Protocol::Motor |
MotorSingle | 0x81 | D | 한 개의 모터 제어 | Protocol::MotorSingle |
IrMessage | 0x82 | D | IR 데이터 송수신 | Protocol::IrMessage |
Buzzer | 0x83 | C | 버저 제어 | Protocol::Buzzer |
Vibrator | 0x84 | C | 진동 제어 | Protocol::Vibrator |
CountFlight | 0x90 | D | 비행 관련 카운트 | Protocol::CountFlight |
CountDrive | 0x91 | D | 주행 관련 카운트 | Protocol::CountDrive |
Pairing | 0xA0 | A | 페어링 | Protocol::Pairing |
Rssi | 0xA1 | A | RSSI | Protocol::Rssi |
DisplayClear | 0xB0 | C | 화면 지우기 | Protocol::Display::ClearAll, Protocol::Display::Clear |
DisplayInvert | 0xB1 | C | 화면 반전 | Protocol::Display::Invert |
DisplayDrawPoint | 0xB2 | C | 점 그리기 | Protocol::Display::DrawPoint |
DisplayDrawLine | 0xB3 | C | 선 그리기 | Protocol::Display::DrawLine |
DisplayDrawRect | 0xB4 | C | 사각형 그리기 | Protocol::Display::DrawRect |
DisplayDrawCircle | 0xB5 | C | 원 그리기 | Protocol::Display::DrawCircle |
DisplayDrawString | 0xB6 | C | 문자열 쓰기 | Protocol::Display::DrawString |
DisplayDrawStringAlign | 0xB7 | C | 문자열 정렬하여 쓰기 | Protocol::Display::DrawStringAlign |
InformationAssembledForController | 0xD0 | D | 자주 갱신되는 데이터 모음(조종기) | Protocol::InformationAssembledForController |
InformationAssembledForEntry | 0xD1 | D | 자주 갱신되는 데이터 모음(엔트리) | Protocol::InformationAssembledForEntry |
- A: 모든 장치(All)
- C: 조종기(Controller)
- D: 드론(Drone)