digidotcom / xbee-csharp

C# library to interact with Digi International's XBee radio frequency modules from mobile devices.
Mozilla Public License 2.0
14 stars 8 forks source link

SerialPort support? #3

Open dotKokott opened 4 years ago

dotKokott commented 4 years ago

It seems that currently the C# version of the library only supports Bluethooth to connect to a local device.

Are there any plans to support a USB Serial connection as well in the near future?

hgonzaleDigi commented 4 years ago

Hello @dotKokott,

Currently, serial interface communication is not supported in the "official" release, meaning, it is not included as a nuget package. However, we have implemented the serial interface support (only for Windows) and it is included in this branch.

There you can find several examples on how to work with the library.

Regards, Hector.

usmanshahid001 commented 4 years ago

how to install xbeeLibrary.windows as there is not any nudget package as you mentioned.thanks

usmanshahid001 commented 4 years ago

where to find XBeeLibrary.windows.dll as it is being referred in all files.

hgonzaleDigi commented 4 years ago

To do so, you need to checkout the branch from the above link (which includes the Windows support). With all the files that are downloaded, open the solution with the XBeeLibrary.sln file (just double-click on it and visual studio will open automatically, if you have it installed).

Once the solution is fully loaded in Visual Studio, right-click on the solution and select "build" in the contextual menu (or simply go to the top toolbar and click on Build -> Build Solution).

This process will generate a bin folder in \XBeeLibrary.Windows. In that folder, depending on whether you built the solution in debug or release mode, you will find the corresponding folder and inside there you will find the Windows and the Core DLL files that you need to import to your project.

usmanshahid001 commented 4 years ago

well i followed all the steps but there are some errors produced upon building the project..

Severity Code Description Project File Line Suppression State Error CS0246 The type or namespace name 'ICloneable' could not be found (are you missing a using directive or an assembly reference?) XBeeLibrary.Core C:\Users\usman\Documents\GitHub\xbeeCoordinatorC#\xbee-csharp-windows_module\xbee-csharp-windows_module\XBeeLibrary.Core\Models\XBeeFirmware.cs 33 Active Error CS0115 'XBeeFirmware.Equals(object)': no suitable method found to override XBeeLibrary.Core C:\Users\usman\Documents\GitHub\xbeeCoordinatorC#\xbee-csharp-windows_module\xbee-csharp-windows_module\XBeeLibrary.Core\Models\XBeeFirmware.cs 235 Active Error CS0115 'XBeeFirmware.GetHashCode()': no suitable method found to override XBeeLibrary.Core C:\Users\usman\Documents\GitHub\xbeeCoordinatorC#\xbee-csharp-windows_module\xbee-csharp-windows_module\XBeeLibrary.Core\Models\XBeeFirmware.cs 251 Active Error CS0115 'XBeeFirmware.ToString()': no suitable method found to override XBeeLibrary.Core C:\Users\usman\Documents\GitHub\xbeeCoordinatorC#\xbee-csharp-windows_module\xbee-csharp-windows_module\XBeeLibrary.Core\Models\XBeeFirmware.cs 260 Active Error CS0120 An object reference is required for the non-static field, method, or property 'object.MemberwiseClone()' XBeeLibrary.Core C:\Users\usman\Documents\GitHub\xbeeCoordinatorC#\xbee-csharp-windows_module\xbee-csharp-windows_module\XBeeLibrary.Core\Models\XBeeFirmware.cs 553 Active Error Package Plugin.BLE 1.3.0 is not compatible with netstandard2.0 (.NETStandard,Version=v2.0). Package Plugin.BLE 1.3.0 supports:

hgonzaleDigi commented 4 years ago

It seems there is some sort of problem with the configuration of your project. But this is not enough invormation for us to verify what could be going on with it.

Please, try to create a new project from scratch (If you are building a Windows Forms App): image

Once created, right-click on the solution: solution_explorer

Click on properties, and select the Application tab where the information of the project resides: image

If all the information matches the one in this screenshot continue by adding the core and Windows DLLs to the project: solution_explorer_references

Click on Add reference in the contextual menu and Browse for the DLL files of both Windows and Core libraries. Once added to the list, select them and click OK and both libraries should be imported to your project without any errors.

This is the manual way, but the core library could also be installed through the NuGet Package manager.

usmanshahid001 commented 4 years ago

i updated my visual studio and now i am able to install XbeeLibrary.core and Xbeelibrary.xamrian successfully. actually my .netstandard was 1.3 but i m unable to build .sln provided in library folder in order to get xbeeLibrary.widoes.dll

usmanshahid001 commented 4 years ago

can you please provide xbeeLibrary.windows.dll? i am unable to generate it by building solution.nuget packages are installed successfully .

hgonzaleDigi commented 4 years ago

The library is built for .netstandard 2.0, that may be the issue for you not being able to build or import the NuGets. Please, update to that version, otherwise we cannot assure you the library will work for you.

The DLL is subject to change as code is developed, so it would be better for you to create a project with the appropriate versions of the framework and build the DLL yourself so for next code updates, you can download the code and build the Windows support library.

usmanshahid001 commented 4 years ago

done.thanks a lot dear.so nice of you...