Skip to content

Commit

Permalink
Merge pull request #3 from cslrfid/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
ksclam authored Feb 21, 2024
2 parents d992c2a + 8e4ec85 commit 0f8b5a0
Show file tree
Hide file tree
Showing 90 changed files with 52,633 additions and 601 deletions.
Binary file not shown.
Binary file added APK Release/CS710SCSDemo0.1.6-049.apk
Binary file not shown.
Binary file added APK Release/CS710SCSDemo0.1.6-050.apk
Binary file not shown.
Binary file added APK Release/CS710SCSDemo0.1.6-051.apk
Binary file not shown.
Binary file added APK Release/CS710SCSDemo0.1.6-052.apk
Binary file not shown.
Binary file added APK Release/CS710SCSDemo0.1.6-053.apk
Binary file not shown.
Binary file added APK Release/CS710SCSDemo0.1.6-054.apk
Binary file not shown.
Binary file added APK Release/CS710SCSDemo0.1.6-055.apk
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ VisualStudioVersion = 17.2.32427.441
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Library", "Library", "{129A7404-6BDF-4303-82F0-29AE7ED69903}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CSLibraryBT5-NETStandard", "Library\CSLibrary\CSLibraryBT5-NETStandard.csproj", "{22CFB5A2-C51E-42BF-9394-3C4F2415E69C}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CSLibrary2024-NETStandard", "Library\CSLibrary\CSLibrary2024-NETStandard.csproj", "{22CFB5A2-C51E-42BF-9394-3C4F2415E69C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MobileMvxApp", "MobileMvxApp", "{704DE96C-C11F-455C-BB36-6EFBAC1C5F93}"
EndProject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace>CSLibrary</RootNamespace>
<AssemblyName>CSLibrary</AssemblyName>
<AssemblyName>CSLibrary2024.NETSTD2</AssemblyName>
<Version>3.0.3</Version>
</PropertyGroup>

Expand Down
15 changes: 14 additions & 1 deletion Library/CSLibrary/Source/BarcodeReader/ClassBarCode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,10 @@ internal bool DeviceRecvData(byte[] recvData)
if (recvData.Length < 24 || recvData[15] != 0x01 || recvData[16] != 0x06 || recvData[23] != 0x01 || recvData[24] != 0x06)
FactoryReset();
else
{
FactoryReset_Second();
_state = STATE.READY;

}
return true;
}

Expand Down Expand Up @@ -416,6 +418,10 @@ public bool FastBarcodeMode (bool enable)
readonly byte[] barcodecmd_V4Format2Step11 = new byte[] { 0x6E, 0x6C, 0x73, 0x30, 0x35, 0x30, 0x32, 0x31, 0x31, 0x30 };
readonly byte[] barcodecmd_V4Format2Step12 = new byte[] { 0x6E, 0x6C, 0x73, 0x30, 0x30, 0x30, 0x31, 0x31, 0x35, 0x30, 0x3B, 0x6E, 0x6C, 0x73, 0x30, 0x30, 0x30, 0x36, 0x30, 0x30, 0x30, 0x3B };

readonly byte[] barcodecmd_T14FormatStep01 = new byte[] { 0x6E, 0x6C, 0x73, 0x30, 0x30, 0x30, 0x36, 0x30, 0x31, 0x30, 0x3B };
readonly byte[] barcodecmd_T14FormatStep02 = new byte[] { 0x6E, 0x6C, 0x73, 0x30, 0x34, 0x30, 0x35, 0x31, 0x30, 0x30, 0x3B };
readonly byte[] barcodecmd_T14FormatStep03 = new byte[] { 0x6E, 0x6C, 0x73, 0x30, 0x30, 0x30, 0x36, 0x30, 0x30, 0x30, 0x3B };

internal void CheckHWValid()
{
//var a = GetLRC(new byte[] { 0x48, 0x30, 0x32, 0x30 });
Expand Down Expand Up @@ -471,6 +477,13 @@ public void FactoryReset()
//_deviceHandler.SendAsync(0, 1, DOWNLINKCMD.BARCODERAWDATA, barcodecmd_QueryReadingMode, CSLibrary.HighLevelInterface.BTWAITCOMMANDRESPONSETYPE.WAIT_BTAPIRESPONSE_DATA1);
}

internal void FactoryReset_Second()
{
_deviceHandler.SendAsync(0, 1, DOWNLINKCMD.BARCODERAWDATA, barcodecmd_T14FormatStep01, CSLibrary.HighLevelInterface.BTWAITCOMMANDRESPONSETYPE.WAIT_BTAPIRESPONSE_DATA1);
_deviceHandler.SendAsync(0, 1, DOWNLINKCMD.BARCODERAWDATA, barcodecmd_T14FormatStep02, CSLibrary.HighLevelInterface.BTWAITCOMMANDRESPONSETYPE.WAIT_BTAPIRESPONSE_DATA1);
_deviceHandler.SendAsync(0, 1, DOWNLINKCMD.BARCODERAWDATA, barcodecmd_T14FormatStep03, CSLibrary.HighLevelInterface.BTWAITCOMMANDRESPONSETYPE.WAIT_BTAPIRESPONSE_DATA1);
}

// LRC : Data checkout value 1 bytes(Computing method: 0xff^lens^types^data
Byte GetLRC (Byte [] data)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

using System;

namespace CSLibrary
{
public static class Debug
Expand All @@ -33,12 +35,14 @@ public static void WriteBytes(string header, byte[] data)

public static void WriteLine(string format, params object[] args)
{
Plugin.BLE.Abstractions.Trace.Message(string.Format(format, args));
Console.WriteLine(string.Format(format, args));
//Plugin.BLE.Abstractions.Trace.Message(string.Format(format, args));
}

public static void Write(string format, params object[] args)
{
Plugin.BLE.Abstractions.Trace.Message(string.Format(format, args));
Console.Write(string.Format(format, args));
//Plugin.BLE.Abstractions.Trace.Message(string.Format(format, args));
}
}
}
26 changes: 23 additions & 3 deletions Library/CSLibrary/Source/HAL/btframework/ClassDeviceFinder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ namespace CSLibrary
{
public partial class DeviceFinder
{
static private wclBluetoothManager Manager;
static internal wclBluetoothRadio Radio;
static private wclBluetoothManager Manager = null;
static internal wclBluetoothRadio Radio = null;

/// <summary>
/// DeviceFinder Argument
Expand Down Expand Up @@ -177,6 +177,7 @@ static private wclBluetoothRadio GetRadio()

static public void Stop()
{

/*
/// <summary>
/// Stops watching for all nearby Bluetooth devices.
Expand All @@ -193,7 +194,26 @@ static public void Stop()
*/
}

static public void ClearDeviceList()
/// <summary>
/// Close BT Libraray
/// </summary>
static public void Disconnect()
{
/* if (Radio != null)
{
Radio.TurnOff();
Radio = null;
}
*/

if (Manager != null)
{
Manager.Close();
Manager = null;
}
}

static public void ClearDeviceList()
{
_deviceDB.Clear ();
}
Expand Down
15 changes: 10 additions & 5 deletions Library/CSLibrary/Source/HAL/btframework/CodeFileBLE.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

using wclCommon;
using wclBluetooth;
using static CSLibrary.RFIDDEVICE;

namespace CSLibrary
{
Expand All @@ -25,7 +26,8 @@ public partial class HighLevelInterface
wclGattService CS108Service;
wclGattCharacteristic UpdateCharacteristic;
wclGattCharacteristic WriteCharacteristic;
//= FCharacteristics[lvCharacteristics.SelectedItems[0].Index];
wclGattCharacteristic ReadCharacteristic;
MODEL _deviceType = MODEL.UNKNOWN;

IDevice _device = new IDevice();

Expand Down Expand Up @@ -66,7 +68,7 @@ private void Cleanup()
FServices = null;
}

public async Task<bool> ConnectAsync(object macAdd)
public async Task<bool> ConnectAsync(object macAdd, MODEL deviceType)
{
if (_readerState != READERSTATE.DISCONNECT)
return false; // reader can not reconnect
Expand All @@ -76,6 +78,8 @@ public async Task<bool> ConnectAsync(object macAdd)
//Client = new wclGattClient();
Int32 Res;


_deviceType = deviceType;
Client.Address = (long)macAdd;
Res = Client.Connect(DeviceFinder.Radio);
if (Res != wclErrors.WCL_E_SUCCESS)
Expand Down Expand Up @@ -113,7 +117,8 @@ void Client_OnConnect(object Sender, int Error)
foreach (wclGattService Service in FServices)
{
if (Service.Uuid.IsShortUuid)
if (Service.Uuid.ShortUuid == 0x9800)
//if (Service.Uuid.ShortUuid == 0x9800)
if (Service.Uuid.ShortUuid == 0x9800 || Service.Uuid.ShortUuid == 0x9802) // CS108=9800, CS710S=9802
CS108Service = Service;
}

Expand Down Expand Up @@ -165,11 +170,10 @@ void Client_OnConnect(object Sender, int Error)
public async Task<bool> DisconnectAsync()
{
if (Status != READERSTATE.IDLE)
return false;
_handlerRFIDReader.StopOperation();

BARCODEPowerOff();
WhenBLEFinish(ClearConnection);

return true;
}

Expand All @@ -190,6 +194,7 @@ void Client_OnCharacteristicChanged(object Sender, ushort Handle, byte[] Value)
if (Value != null)
if (Value.Length > 0)
{
CSLibrary.Debug.WriteBytes("BT reveice data : ", Value);
CharacteristicOnValueUpdated(Value);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v3.1",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v3.1": {
"wclBluetoothFramework/7.17.0.0": {
"dependencies": {
"wclCommon": "7.11.5.0",
"wclCommunication": "7.8.1.0"
},
"runtime": {
"wclBluetoothFramework.dll": {}
}
},
"wclCommon/7.11.5.0": {
"runtime": {
"wclCommon.dll": {
"assemblyVersion": "7.11.5.0",
"fileVersion": "7.11.5.0"
}
}
},
"wclCommunication/7.8.1.0": {
"runtime": {
"wclCommunication.dll": {
"assemblyVersion": "7.8.1.0",
"fileVersion": "7.8.1.0"
}
}
}
}
},
"libraries": {
"wclBluetoothFramework/7.17.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
},
"wclCommon/7.11.5.0": {
"type": "reference",
"serviceable": false,
"sha512": ""
},
"wclCommunication/7.8.1.0": {
"type": "reference",
"serviceable": false,
"sha512": ""
}
}
}
Binary file not shown.
Loading

0 comments on commit 0f8b5a0

Please sign in to comment.