Skip to content

Commit

Permalink
camera: rename status to storage
Browse files Browse the repository at this point in the history
Givent that's really what it is.
  • Loading branch information
julianoes committed Oct 28, 2024
1 parent 82fb558 commit 334d9b3
Showing 1 changed file with 55 additions and 51 deletions.
106 changes: 55 additions & 51 deletions protos/camera/camera.proto
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ service CameraService {
*/
rpc SubscribeCaptureInfo(SubscribeCaptureInfoRequest) returns(stream CaptureInfoResponse) { option (mavsdk.options.async_type) = ASYNC; }
/*
* Subscribe to camera status updates.
* Subscribe to camera's storage status updates.
*/
rpc SubscribeStatus(SubscribeStatusRequest) returns(stream StatusResponse) { option (mavsdk.options.async_type) = ASYNC; }
rpc SubscribeStorage(SubscribeStorageRequest) returns(stream StorageResponse) { option (mavsdk.options.async_type) = ASYNC; }
/*
* Get camera status.
* Get camera's storage status.
*/
rpc GetStatus(GetStatusRequest) returns(GetStatusResponse) { option (mavsdk.options.async_type) = SYNC; }
rpc GetStorage(GetStorageRequest) returns(GetStorageResponse) { option (mavsdk.options.async_type) = SYNC; }
/*
* Get the list of current camera settings.
*/
Expand Down Expand Up @@ -328,9 +328,51 @@ message CaptureInfoResponse {
CaptureInfo capture_info = 1; // Capture info
}

message SubscribeStatusRequest {}
message StatusResponse {
Status camera_status = 1; // Camera status
// Information about the camera's storage status.
message Storage {
// Storage status type.
enum StorageStatus {
STORAGE_STATUS_NOT_AVAILABLE = 0; // Status not available
STORAGE_STATUS_UNFORMATTED = 1; // Storage is not formatted (i.e. has no recognized file system)
STORAGE_STATUS_FORMATTED = 2; // Storage is formatted (i.e. has recognized a file system)
STORAGE_STATUS_NOT_SUPPORTED = 3; // Storage status is not supported
}

// Storage type.
enum StorageType {
STORAGE_TYPE_UNKNOWN = 0; // Storage type unknown
STORAGE_TYPE_USB_STICK = 1; // Storage type USB stick
STORAGE_TYPE_SD = 2; // Storage type SD card
STORAGE_TYPE_MICROSD = 3; // Storage type MicroSD card
STORAGE_TYPE_HD = 7; // Storage type HD mass storage
STORAGE_TYPE_OTHER = 254; // Storage type other, not listed
}

int32 camera_id = 1; // Camera ID
bool video_on = 2; // Whether video recording is currently in process
bool photo_interval_on = 3; // Whether a photo interval is currently in process

float used_storage_mib = 4; // Used storage (in MiB)
float available_storage_mib = 5; // Available storage (in MiB)
float total_storage_mib = 6; // Total storage (in MiB)
float recording_time_s = 7; // Elapsed time since starting the video recording (in seconds)
string media_folder_name = 8; // Current folder name where media are saved

StorageStatus storage_status = 9; // Storage status

uint32 storage_id = 10; // Storage ID starting at 1

StorageType storage_type = 11; // Storage type
}

message StorageUpdate {
int32 camera_id = 1; // Camera ID
Storage storage = 2; // Storage
}

message SubscribeStorageRequest {}
message StorageResponse {
StorageUpdate update = 1; // Camera's storage status
}

message CurrentSettingsUpdate {
Expand Down Expand Up @@ -377,12 +419,12 @@ message GetVideoStreamInfoResponse {
VideoStreamInfo video_stream_info = 2; // Video stream info
}

message GetStatusRequest {
message GetStorageRequest {
int32 camera_id = 1; // Camera ID
}
message GetStatusResponse {
message GetStorageResponse {
CameraResult camera_result = 1;
Status status = 2; // Camera status
Storage storage = 2; // Camera's storage status
}

message GetCurrentSettingsRequest {
Expand Down Expand Up @@ -527,10 +569,9 @@ message CameraResult {
RESULT_WRONG_ARGUMENT = 7; // Command has wrong argument(s)
RESULT_NO_SYSTEM = 8; // No system connected
RESULT_PROTOCOL_UNSUPPORTED = 9; // Definition file protocol not supported
RESULT_SETTINGS_UNAVAILABLE = 10; // Settings not available
RESULT_SETTINGS_LOADING = 11; // Settings not available yet
RESULT_CAMERA_ID_INVALID = 12; // Camera with camera ID not found
RESULT_ACTION_UNSUPPORTED = 13; // Camera action not supported
RESULT_UNAVAILABLE = 10; // Not available (yet)
RESULT_CAMERA_ID_INVALID = 11; // Camera with camera ID not found
RESULT_ACTION_UNSUPPORTED = 12; // Camera action not supported
}

Result result = 1; // Result enum value
Expand Down Expand Up @@ -601,43 +642,6 @@ message CaptureInfo {
string file_url = 8; // Download URL of this image
}

// Information about the camera status.
message Status {
// Storage status type.
enum StorageStatus {
STORAGE_STATUS_NOT_AVAILABLE = 0; // Status not available
STORAGE_STATUS_UNFORMATTED = 1; // Storage is not formatted (i.e. has no recognized file system)
STORAGE_STATUS_FORMATTED = 2; // Storage is formatted (i.e. has recognized a file system)
STORAGE_STATUS_NOT_SUPPORTED = 3; // Storage status is not supported
}

// Storage type.
enum StorageType {
STORAGE_TYPE_UNKNOWN = 0; // Storage type unknown
STORAGE_TYPE_USB_STICK = 1; // Storage type USB stick
STORAGE_TYPE_SD = 2; // Storage type SD card
STORAGE_TYPE_MICROSD = 3; // Storage type MicroSD card
STORAGE_TYPE_HD = 7; // Storage type HD mass storage
STORAGE_TYPE_OTHER = 254; // Storage type other, not listed
}

int32 camera_id = 1; // Camera ID
bool video_on = 2; // Whether video recording is currently in process
bool photo_interval_on = 3; // Whether a photo interval is currently in process

float used_storage_mib = 4; // Used storage (in MiB)
float available_storage_mib = 5; // Available storage (in MiB)
float total_storage_mib = 6; // Total storage (in MiB)
float recording_time_s = 7; // Elapsed time since starting the video recording (in seconds)
string media_folder_name = 8; // Current folder name where media are saved

StorageStatus storage_status = 9; // Storage status

uint32 storage_id = 10; // Storage ID starting at 1

StorageType storage_type = 11; // Storage type
}

// Type to represent a camera information.
message Information {
string vendor_name = 1; // Name of the camera vendor
Expand Down

0 comments on commit 334d9b3

Please sign in to comment.