Skip to content

Commit

Permalink
About: cn,tw,mx certification information
Browse files Browse the repository at this point in the history
  • Loading branch information
skotopes committed Dec 25, 2023
1 parent 531ba24 commit 995a7ab
Show file tree
Hide file tree
Showing 10 changed files with 96 additions and 27 deletions.
87 changes: 62 additions & 25 deletions applications/settings/about/about.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

typedef DialogMessageButton (*AboutDialogScreen)(DialogsApp* dialogs, DialogMessage* message);

static DialogMessageButton product_screen(DialogsApp* dialogs, DialogMessage* message) {
static DialogMessageButton about_screen_product(DialogsApp* dialogs, DialogMessage* message) {
DialogMessageButton result;

FuriString* screen_header = furi_string_alloc_printf(
Expand All @@ -31,16 +31,14 @@ static DialogMessageButton product_screen(DialogsApp* dialogs, DialogMessage* me
dialog_message_set_text(
message, furi_string_get_cstr(screen_text), 0, 26, AlignLeft, AlignTop);
result = dialog_message_show(dialogs, message);
dialog_message_set_header(message, NULL, 0, 0, AlignLeft, AlignTop);
dialog_message_set_text(message, NULL, 0, 0, AlignLeft, AlignTop);

furi_string_free(screen_header);
furi_string_free(screen_text);

return result;
}

static DialogMessageButton address_screen(DialogsApp* dialogs, DialogMessage* message) {
static DialogMessageButton about_screen_address(DialogsApp* dialogs, DialogMessage* message) {
DialogMessageButton result;

const char* screen_text = "Flipper Devices Inc\n"
Expand All @@ -50,12 +48,11 @@ static DialogMessageButton address_screen(DialogsApp* dialogs, DialogMessage* me

dialog_message_set_text(message, screen_text, 0, 0, AlignLeft, AlignTop);
result = dialog_message_show(dialogs, message);
dialog_message_set_text(message, NULL, 0, 0, AlignLeft, AlignTop);

return result;
}

static DialogMessageButton compliance_screen(DialogsApp* dialogs, DialogMessage* message) {
static DialogMessageButton about_screen_compliance(DialogsApp* dialogs, DialogMessage* message) {
DialogMessageButton result;

const char* screen_text = "For all compliance\n"
Expand All @@ -64,35 +61,71 @@ static DialogMessageButton compliance_screen(DialogsApp* dialogs, DialogMessage*

dialog_message_set_text(message, screen_text, 0, 0, AlignLeft, AlignTop);
result = dialog_message_show(dialogs, message);
dialog_message_set_text(message, NULL, 0, 0, AlignLeft, AlignTop);

return result;
}

static DialogMessageButton icon1_screen(DialogsApp* dialogs, DialogMessage* message) {
static DialogMessageButton about_screen_icon1(DialogsApp* dialogs, DialogMessage* message) {
DialogMessageButton result;

dialog_message_set_icon(message, &I_Certification1_103x56, 13, 0);
result = dialog_message_show(dialogs, message);
dialog_message_set_icon(message, NULL, 0, 0);

return result;
}

static DialogMessageButton icon2_screen(DialogsApp* dialogs, DialogMessage* message) {
static DialogMessageButton about_screen_icon2(DialogsApp* dialogs, DialogMessage* message) {
DialogMessageButton result;

dialog_message_set_icon(message, &I_Certification2_46x33, 15, 10);
dialog_message_set_text(
message, furi_hal_version_get_mic_id(), 63, 27, AlignLeft, AlignCenter);
result = dialog_message_show(dialogs, message);
dialog_message_set_icon(message, NULL, 0, 0);
dialog_message_set_text(message, NULL, 0, 0, AlignLeft, AlignTop);

return result;
}

static DialogMessageButton hw_version_screen(DialogsApp* dialogs, DialogMessage* message) {
static DialogMessageButton about_screen_cert_china_0(DialogsApp* dialogs, DialogMessage* message) {
DialogMessageButton result;

dialog_message_set_icon(message, &I_CertificationChina0_121x41, 3, 3);
result = dialog_message_show(dialogs, message);

return result;
}

static DialogMessageButton about_screen_cert_china_1(DialogsApp* dialogs, DialogMessage* message) {
DialogMessageButton result;

dialog_message_set_icon(message, &I_CertificationChina1_122x47, 3, 3);
dialog_message_set_text(
message, furi_hal_version_get_srrc_id(), 55, 11, AlignLeft, AlignBottom);
result = dialog_message_show(dialogs, message);

return result;
}

static DialogMessageButton about_screen_cert_taiwan(DialogsApp* dialogs, DialogMessage* message) {
DialogMessageButton result;

dialog_message_set_icon(message, &I_CertificationTaiwan_33x32, 3, 10);
dialog_message_set_text(
message, furi_hal_version_get_ncc_id(), 39, 30, AlignLeft, AlignBottom);
result = dialog_message_show(dialogs, message);

return result;
}

static DialogMessageButton about_screen_cert_mexico(DialogsApp* dialogs, DialogMessage* message) {
DialogMessageButton result;

dialog_message_set_icon(message, &I_CertificationMexico_98x41, 17, 4);
result = dialog_message_show(dialogs, message);

return result;
}

static DialogMessageButton about_screen_hw_version(DialogsApp* dialogs, DialogMessage* message) {
DialogMessageButton result;
FuriString* buffer;
buffer = furi_string_alloc();
Expand All @@ -118,14 +151,12 @@ static DialogMessageButton hw_version_screen(DialogsApp* dialogs, DialogMessage*
dialog_message_set_header(message, "HW Version Info:", 0, 0, AlignLeft, AlignTop);
dialog_message_set_text(message, furi_string_get_cstr(buffer), 0, 13, AlignLeft, AlignTop);
result = dialog_message_show(dialogs, message);
dialog_message_set_text(message, NULL, 0, 0, AlignLeft, AlignTop);
dialog_message_set_header(message, NULL, 0, 0, AlignLeft, AlignTop);
furi_string_free(buffer);

return result;
}

static DialogMessageButton fw_version_screen(DialogsApp* dialogs, DialogMessage* message) {
static DialogMessageButton about_screen_fw_version(DialogsApp* dialogs, DialogMessage* message) {
DialogMessageButton result;
FuriString* buffer;
buffer = furi_string_alloc();
Expand Down Expand Up @@ -157,21 +188,23 @@ static DialogMessageButton fw_version_screen(DialogsApp* dialogs, DialogMessage*
dialog_message_set_header(message, "FW Version Info:", 0, 0, AlignLeft, AlignTop);
dialog_message_set_text(message, furi_string_get_cstr(buffer), 0, 13, AlignLeft, AlignTop);
result = dialog_message_show(dialogs, message);
dialog_message_set_text(message, NULL, 0, 0, AlignLeft, AlignTop);
dialog_message_set_header(message, NULL, 0, 0, AlignLeft, AlignTop);
furi_string_free(buffer);

return result;
}

const AboutDialogScreen about_screens[] = {
product_screen,
compliance_screen,
address_screen,
icon1_screen,
icon2_screen,
hw_version_screen,
fw_version_screen};
about_screen_product,
about_screen_compliance,
about_screen_address,
about_screen_icon1,
about_screen_icon2,
about_screen_cert_china_0,
about_screen_cert_china_1,
about_screen_cert_taiwan,
about_screen_cert_mexico,
about_screen_hw_version,
about_screen_fw_version};

int32_t about_settings_app(void* p) {
UNUSED(p);
Expand Down Expand Up @@ -201,6 +234,10 @@ int32_t about_settings_app(void* p) {

screen_result = about_screens[screen_index](dialogs, message);

dialog_message_set_icon(message, NULL, 0, 0);
dialog_message_set_header(message, NULL, 0, 0, AlignLeft, AlignTop);
dialog_message_set_text(message, NULL, 0, 0, AlignLeft, AlignTop);

if(screen_result == DialogMessageButtonLeft) {
if(screen_index <= 0) {
break;
Expand Down
Binary file added assets/icons/About/CertificationChina0_121x41.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/About/CertificationChina1_122x47.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/About/CertificationMexico_98x41.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/About/CertificationTaiwan_33x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion targets/f18/api_symbols.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
entry,status,name,type,params
Version,+,50.0,,
Version,+,50.1,,
Header,+,applications/services/bt/bt_service/bt.h,,
Header,+,applications/services/cli/cli.h,,
Header,+,applications/services/cli/cli_vcp.h,,
Expand Down Expand Up @@ -1330,7 +1330,9 @@ Function,+,furi_hal_version_get_mic_id,const char*,
Function,+,furi_hal_version_get_model_code,const char*,
Function,+,furi_hal_version_get_model_name,const char*,
Function,+,furi_hal_version_get_name_ptr,const char*,
Function,+,furi_hal_version_get_ncc_id,const char*,
Function,+,furi_hal_version_get_otp_version,FuriHalVersionOtpVersion,
Function,+,furi_hal_version_get_srrc_id,const char*,
Function,-,furi_hal_version_init,void,
Function,+,furi_hal_version_uid,const uint8_t*,
Function,+,furi_hal_version_uid_size,size_t,
Expand Down
8 changes: 8 additions & 0 deletions targets/f18/furi_hal/furi_hal_version_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,11 @@ const char* furi_hal_version_get_ic_id() {
const char* furi_hal_version_get_mic_id() {
return "Pending";
}

const char* furi_hal_version_get_srrc_id() {
return "Pending";
}

const char* furi_hal_version_get_ncc_id() {
return "Pending";
}
4 changes: 3 additions & 1 deletion targets/f7/api_symbols.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
entry,status,name,type,params
Version,+,50.0,,
Version,+,50.1,,
Header,+,applications/drivers/subghz/cc1101_ext/cc1101_ext_interconnect.h,,
Header,+,applications/services/bt/bt_service/bt.h,,
Header,+,applications/services/cli/cli.h,,
Expand Down Expand Up @@ -1526,7 +1526,9 @@ Function,+,furi_hal_version_get_mic_id,const char*,
Function,+,furi_hal_version_get_model_code,const char*,
Function,+,furi_hal_version_get_model_name,const char*,
Function,+,furi_hal_version_get_name_ptr,const char*,
Function,+,furi_hal_version_get_ncc_id,const char*,
Function,+,furi_hal_version_get_otp_version,FuriHalVersionOtpVersion,
Function,+,furi_hal_version_get_srrc_id,const char*,
Function,-,furi_hal_version_init,void,
Function,+,furi_hal_version_uid,const uint8_t*,
Function,+,furi_hal_version_uid_size,size_t,
Expand Down
8 changes: 8 additions & 0 deletions targets/f7/furi_hal/furi_hal_version_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,11 @@ const char* furi_hal_version_get_ic_id() {
const char* furi_hal_version_get_mic_id() {
return "210-175991";
}

const char* furi_hal_version_get_srrc_id() {
return "2023DJ16420";
}

const char* furi_hal_version_get_ncc_id() {
return "CCAJ23LP34D0T3";
}
12 changes: 12 additions & 0 deletions targets/furi_hal_include/furi_hal_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,18 @@ const char* furi_hal_version_get_ic_id();
*/
const char* furi_hal_version_get_mic_id();

/** Get SRRC id
*
* @return SRRC id as C-string
*/
const char* furi_hal_version_get_srrc_id();

/** Get NCC id
*
* @return NCC id as C-string
*/
const char* furi_hal_version_get_ncc_id();

/** Get OTP version
*
* @return OTP Version
Expand Down

0 comments on commit 995a7ab

Please sign in to comment.