Skip to content

Commit

Permalink
chore: Rename COK to CSuccess
Browse files Browse the repository at this point in the history
  • Loading branch information
damonto committed Oct 14, 2024
1 parent 8f051e6 commit 6122c97
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions apdu.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func libeuiccApduConnect(ctx *C.struct_euicc_ctx) C.int {
return CError
}
logger.Debug("APDU connect success")
return COK
return CSuccess
}

//export libeuiccApduDisconnect
Expand Down Expand Up @@ -115,5 +115,5 @@ func libeuiccApduTransmit(ctx *C.struct_euicc_ctx, rx **C.uint8_t, rx_len *C.uin
logger.Debug("APDU transmit success", "command", hex.EncodeToString(b), "response", hex.EncodeToString(r))
*rx = (*C.uint8_t)(C.CBytes(r))
*rx_len = C.uint32_t(len(r))
return COK
return CSuccess
}
4 changes: 2 additions & 2 deletions constant.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ const (
NotificationProfileManagementOperationInstall NotificationProfileManagementOperation = "install"
NotificationProfileManagementOperationDelete NotificationProfileManagementOperation = "delete"

CError C.int = -1
COK C.int = 0
CError C.int = -1
CSuccess C.int = 0
)
4 changes: 2 additions & 2 deletions download.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func (e *Libeuicc) DownloadProfile(ctx context.Context, activationCode *Activati
}

e.handleProgress(downloadOption, DownloadProgressAuthenticateClient)
if C.es9p_authenticate_client(e.euiccCtx) != COK {
if C.es9p_authenticate_client(e.euiccCtx) != CSuccess {
return e.wrapES9PError()
}

Expand Down Expand Up @@ -163,7 +163,7 @@ func (e *Libeuicc) DownloadProfile(ctx context.Context, activationCode *Activati
C.memset(unsafe.Pointer(downloadResult), 0, C.sizeof_struct_es10b_load_bound_profile_package_result)
defer C.free(unsafe.Pointer(downloadResult))
e.handleProgress(downloadOption, DownloadProgressLoadBoundProfile)
if C.es10b_load_bound_profile_package(e.euiccCtx, downloadResult) != COK {
if C.es10b_load_bound_profile_package(e.euiccCtx, downloadResult) != CSuccess {
if err := e.cancelSession(); err != nil {
return errors.Join(e.wrapLoadBPPError(downloadResult), err)
}
Expand Down
2 changes: 1 addition & 1 deletion http.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,5 @@ func libeuiccHttpTransmit(_ *C.struct_euicc_ctx, url *C.char, rcode *C.uint32_t,
*rx = (*C.uint8_t)(C.CBytes(body))
*rx_len = C.uint32_t(len(body))
*rcode = C.uint32_t(resp.StatusCode)
return COK
return CSuccess
}
2 changes: 1 addition & 1 deletion profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func (e *Libeuicc) DeleteProfile(iccid string) error {
}

func (e *Libeuicc) wrapProfileOperationError(err C.int) error {
if err == COK {
if err == CSuccess {
return nil
}
switch err {
Expand Down

0 comments on commit 6122c97

Please sign in to comment.