mirror of
https://github.com/aaru-dps/aaruremote.git
synced 2025-12-16 19:24:37 +00:00
Add open device packet.
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
#define DICMOTE_PACKET_TYPE_HELLO 1
|
||||
#define DICMOTE_PACKET_TYPE_COMMAND_LIST_DEVICES 2
|
||||
#define DICMOTE_PACKET_TYPE_RESPONSE_LIST_DEVICES 3
|
||||
#define DICMOTE_PACKET_TYPE_COMMAND_OPEN_DEVICE 4
|
||||
#define DICMOTE_PROTOCOL_MAX 1
|
||||
#define DICMOTE_PACKET_NOP_REASON_OOO 0
|
||||
#define DICMOTE_PACKET_NOP_REASON_NOT_IMPLEMENTED 1
|
||||
@@ -94,6 +95,12 @@ typedef struct
|
||||
int32_t errno;
|
||||
} DicPacketNop;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
DicPacketHeader hdr;
|
||||
char device_path[1024];
|
||||
} DicPacketCmdOpen;
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
DeviceInfoList* ListDevices();
|
||||
|
||||
8
main.c
8
main.c
@@ -387,6 +387,14 @@ int main()
|
||||
printf("%s...\n", pkt_nop->reason);
|
||||
skip_next_hdr = 1;
|
||||
continue;
|
||||
case DICMOTE_PACKET_TYPE_COMMAND_OPEN_DEVICE:
|
||||
pkt_nop->reason_code = DICMOTE_PACKET_NOP_REASON_NOT_IMPLEMENTED;
|
||||
memset(&pkt_nop->reason, 0, 256);
|
||||
strncpy(pkt_nop->reason, "Opening devices not yet implemented...", 256);
|
||||
write(cli_sock, pkt_nop, sizeof(DicPacketNop));
|
||||
printf("%s...\n", pkt_nop->reason);
|
||||
skip_next_hdr = 1;
|
||||
continue;
|
||||
default:
|
||||
pkt_nop->reason_code = DICMOTE_PACKET_NOP_REASON_NOT_RECOGNIZED;
|
||||
memset(&pkt_nop->reason, 0, 256);
|
||||
|
||||
Reference in New Issue
Block a user