File: fu-logitech-bulkcontroller.rs

package info (click to toggle)
fwupd 2.0.19-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 32,340 kB
  • sloc: ansic: 274,440; python: 11,468; xml: 9,432; sh: 1,625; makefile: 167; cpp: 19; asm: 11; javascript: 9
file content (80 lines) | stat: -rw-r--r-- 1,624 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
// Copyright 2023 Richard Hughes <richard@hughsie.com>
// SPDX-License-Identifier: LGPL-2.1-or-later

#[derive(ToString)]
enum FuLogitechBulkcontrollerDeviceState {
    Unknown = -1,
    Offline,
    Online,
    Idle,
    InUse,
    AudioOnly,
    Enumerating,
}

#[derive(ToString)]
enum FuLogitechBulkcontrollerUpdateState {
    Unknown = -1,
    Current,
    Available,
    Starting = 3,
    Downloading,
    Ready,
    Updating,
    Scheduled,
    Error,
}

#[repr(u32le)]
#[derive(ToString)]
enum FuLogitechBulkcontrollerCmd {
    CheckBuffersize = 0xCC00,
    Init = 0xCC01,
    StartTransfer = 0xCC02,
    DataTransfer = 0xCC03,
    EndTransfer = 0xCC04,
    Uninit = 0xCC05,
    BufferRead = 0xCC06,
    BufferWrite = 0xCC07,
    UninitBuffer = 0xCC08,
    Ack = 0xFF01,
    Timeout = 0xFF02,
    Nack = 0xFF03,
}

#[derive(New, ToString, Getters)]
#[repr(C, packed)]
struct FuStructLogitechBulkcontrollerSendSyncReq {
    cmd: FuLogitechBulkcontrollerCmd,
    payload_length: u32le,
    sequence_id: u32le,
}

#[derive(Parse)]
#[repr(C, packed)]
struct FuStructLogitechBulkcontrollerSendSyncRes {
    cmd: FuLogitechBulkcontrollerCmd,
    payload_length: u32le,
    sequence_id: u32le,
}

#[derive(New)]
#[repr(C, packed)]
struct FuStructLogitechBulkcontrollerUpdateReq {
    cmd: FuLogitechBulkcontrollerCmd,
    payload_length: u32le,
}

#[derive(Parse)]
#[repr(C, packed)]
struct FuStructLogitechBulkcontrollerUpdateRes {
    cmd: FuLogitechBulkcontrollerCmd,
    _payload_length: u32le,
    cmd_req: FuLogitechBulkcontrollerCmd,
}

enum FuLogitechBulkcontrollerChecksumType {
    Sha256,
    Sha512,
    Md5,
}