Skip to content

Commit

Permalink
Move gb2ws, ws2gb to PATCH + add @platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
Azq2 committed Jun 8, 2024
1 parent 1ff80bf commit 3a86579
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 23 deletions.
8 changes: 7 additions & 1 deletion swilib/include/swilib/gprs.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,10 @@ void GPRS_OnOff(int enable, int unk)
__swi_end(0x18E, GPRS_OnOff, (enable, unk));

/**
* Get an ID of the active internet profile (SGOLD only).
* Get an ID of the active internet profile.
* @return ID
* @platforms X75, SG
* @warning SGOLD only
* */
__swi_begin(0x1A3)
int GetCurrentGPRSProfile(void)
Expand All @@ -156,6 +158,7 @@ __swi_end(0x1A3, GetCurrentGPRSProfile, ());
* Change current internet profile.
* @param profile_id ID of the profile
* @return status
* @platforms X75, SG
* @warning SGOLD only
* */
__swi_begin(0x23C)
Expand All @@ -174,6 +177,7 @@ __swi_end(0x23C, SetCurrentGPRSProfile, (profile_id));
* @param cepid current CEPID, use #GBS_GetCurCepid
* @param profile_id GPRS profile ID, use #GetCurrentGPRSProfile
* @return status
* @platforms X75, SG
* @warning SGOLD only, call only from SUBPROC.
* */
__swi_begin(0x1A2)
Expand All @@ -185,6 +189,7 @@ __swi_end(0x1A2, ActivateDialUpProfile, (cepid, profile_id));
* @param cepid current CEPID, use #GBS_GetCurCepid
* @param profile_id GPRS profile ID, use #GetCurrentGPRSProfile
* @param is_gprs connection type, 1: GPRS, 0: CSD
* @platforms X75, SG
* @warning SGOLD only, call only from SUBPROC.
* */
__swi_begin(0x1A5)
Expand All @@ -194,6 +199,7 @@ __swi_end(0x1A5, RegisterCepIdForCurProfile, (cepid, profile_id, is_gprs));
/**
* Get internet connection timeout for disconnect when there is no activity.
* @return seconds
* @platforms X75, SG
* @warning SGOLD only
* */
__swi_begin(0x1A4)
Expand Down
1 change: 1 addition & 0 deletions swilib/include/swilib/misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ __swi_end(0x093, RebootPhone, ());
/**
* Set state for SLI indicator.
* @param state state value 0...4
* @platforms ELKA
* */
__swi_begin(0x036)
void SLI_SetState(uint8_t state)
Expand Down
24 changes: 24 additions & 0 deletions swilib/include/swilib/patch.h
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,30 @@ __swi_begin(0x009E)
int GetMissedEventCount(uint32_t Event)
__swi_end(0x009E, GetMissedEventCount, (Event));

/**
* Convert Chinese one-byte C-string to WHSDR.
* @param destination pointer to the destination WSHDR, which should be large enough to contain the source string
* @param source input C-string to be converted to WSHDR
* @param size maximum number of characters to be converted
* @warning Only for Chinese firmwares!
* @warning Function from the patch "API", see: https://patches.kibab.com/patches/search.php5?action=search&kw=API
* */
__swi_begin(0x242)
void gb2ws(WSHDR *destination, const char *source, int size)
__swi_end(0x242, gb2ws, (destination, source, size));

/**
* Convert WSHDR to the Chinese one-byte C-string.
* @param source input WSHDR to be converted to C-string
* @param destination pointer to the destination C-string, which should be large enough to contain the source WSHDR
* @param size maximum number of characters to be converted
* @warning Only for Chinese firmwares!
* @warning Function from the patch "API", see: https://patches.kibab.com/patches/search.php5?action=search&kw=API
* */
__swi_begin(0x243)
void ws2gb(const WSHDR *source, char *destination, int size)
__swi_end(0x243, ws2gb, (source, destination, size));

/** @} */

/**
Expand Down
1 change: 1 addition & 0 deletions swilib/include/swilib/ui.h
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@ __swi_end(0x027, AddIconToIconBar, (pic, num));
/**
* Pointer to the status of iconbar (EL/E71).
* @return 1: enabled, 0: disabled
* @platforms ELKA
*
* ```C
* int iconbar_is_enabled = *RamIconBar();
Expand Down
22 changes: 0 additions & 22 deletions swilib/include/swilib/wstring.h
Original file line number Diff line number Diff line change
Expand Up @@ -348,28 +348,6 @@ __swi_begin(0x0A3)
void ws_2str(const WSHDR *source, char *destination, uint32_t size)
__swi_end(0x0A3, ws_2str, (source, destination, size));

/**
* Convert Chinese one-byte C-string to WHSDR.
* @param destination pointer to the destination WSHDR, which should be large enough to contain the source string
* @param source input C-string to be converted to WSHDR
* @param size maximum number of characters to be converted
* @warning Only for Chinese firmwares.
* */
__swi_begin(0x242)
void gb2ws(WSHDR *destination, const char *source, int size)
__swi_end(0x242, gb2ws, (destination, source, size));

/**
* Convert WSHDR to the Chinese one-byte C-string.
* @param source input WSHDR to be converted to C-string
* @param destination pointer to the destination C-string, which should be large enough to contain the source WSHDR
* @param size maximum number of characters to be converted
* @warning Only for Chinese firmwares.
* */
__swi_begin(0x243)
void ws2gb(const WSHDR *source, char *destination, int size)
__swi_end(0x243, ws2gb, (source, destination, size));

/** @} */

__swilib_end
Expand Down

0 comments on commit 3a86579

Please sign in to comment.