A powerful and feature-rich c# client library for communicating with Unisoc(Spreadtrum) devices. SPRDClient is based on this project, see thisINTRODUCTION OF SPRDCLIENT.
- Support kicking device to cali_diag/dl_diag(sprd4)
- Support (re)connecting device in all stages(brom/fdl1/fdl2)
- Support sending fdls to specified address and execute
- Support reading/writing partitions in fdl2 stage
- Support getting partition list in fdl2 stage
- Support reseting device to normal/recovery/fastboot modes
- Developing with c# .net
- Easy to develop your own SPRD(unisoc) flash tool with SPRDClientCore
- Clone this project to your own computer
- Open the solution with Visual Studio 2022 or newer
- Install System.IO.Ports and System.Management libraries in NuGet Package Manager
- Now you can start developing easily with SPRDClientCore
- Optional But Recommended: Add all the usings as global usings in your project, just like
global using SPRDClientCore.Models;
global using SPRDClientCore.Utils;
global using SPRDClientCore.Protocol;
global using SPRDClientCore.Protocol.CheckSums;
global using SPRDClientCore.Protocol.Encoders;
global using static SPRDClientCore.Utils.SprdFlashUtils;
global using static SPRDClientCore.Models.SprdExceptions;
global using static SPRDClientCore.Models.SprdCommand;
- Optional: You can build this project into a DLL so that you can import the libraries in other projects easily
You can easily find port by calling the static function SprdProtocolHandler.FindComPort()
.
SprdProtocolHandler is a class which implement IProtocolHandler interface and can be used to communicate with unisoc(sprd) devices such as sending and receiving packets with sprd driver on Windows Platform. SprdFlashUtils is an important class with all the common functions like ConnectToDevice, SendFile, WritePartition, ReadPartitionCustomize, Repartition and so on.
Here is an example:
string port = SprdProtocolHandler.FindComPort(timeout: 30000);
SprdProtocolHandler handler = new SprdProtocolHandler(port,new HdlcEncoder());
SprdFlashUtils utils = new SprdFlashUtils(handler);
"Stages" is an enum,including brom,fdl1,fdl2,sprd3 and sprd4. You can use ConnectToDevice()
function to get the device stages. The function returns (Stages SprdMode, Stages Stage).
Here is an example:
var stages = utils.ConnectToDevice();
Stages deviceSprdMode = stages.SprdMode;
Stages deviceStage = stages.Stage;