package main
import (
"context"
"fmt"
"time"
"github.com/damonto/libeuicc-go"
"github.com/damonto/libeuicc-go/driver/pcsc"
)
func main() {
pcscReader, err := pcsc.New()
if err != nil {
fmt.Println(err)
return
}
euicc, err := libeuicc.New(pcscReader, libeuicc.NewDefaultLogger(libeuicc.LogErrorLevel))
if err != nil {
fmt.Println(err)
return
}
defer euicc.Close()
fmt.Println(euicc.GetEid())
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute)
err = euicc.DownloadProfile(ctx, &libeuicc.ActivationCode{
SMDP: "rsp.septs.app",
MatchingId: "123413231",
}, &libeuicc.DownloadOption{
ProgressBar: func(progress libeuicc.DownloadProgress) {
// If you want to download, please remove this line.
if progress == libeuicc.DownloadProgressGetBoundProfile {
cancel()
}
fmt.Println(progress)
},
ConfirmationCodeFunc: func() string {
fmt.Println("Please input confirmation code:")
return ""
},
ConfirmFunc: func(metadata *libeuicc.ProfileMetadata) bool {
fmt.Println(metadata)
return false
},
})
if err != nil {
fmt.Println(err)
return
}
fmt.Println("Download profile success")
}
-
Notifications
You must be signed in to change notification settings - Fork 0
Libeuicc Go bindings
License
damonto/libeuicc-go
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Libeuicc Go bindings
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published