![]() |
|
#1
|
||||
|
||||
|
Today we are releasing V1.0 of our Software Devleopment Kit (SDK) which includes an Application Program Interface (API) DLL for the P2140 regulator. Please note that this API requires version 1.8+ firmware.
CarNetix P2140 SDK V1.0 The SDK includes: 1) SDK Guide 2) Demo program 3) P2140API.dll 4) USB drivers 5) P2140API Help File Unfortunately, I am by no means an expert in this area and will be relying on some of you experts to help me get the appropriate information documented for the various applications you may want develop. FYI, for those of you who have not taken the C# .NET 2.0 plunge, Microsoft is giving away (ie free) the Visual Studio Express IDE. It can make decent programmers out of your averae Joe (ie me). You may want to give it a try since it may make developing applications with the P2140API a bit easier. Please provde any comments, questions, or feedback in this thread. Enjoy! Last edited by mikeh; 09-12-2007 at 09:55 PM. |
|
#2
|
|||
|
|||
|
Hi Mike, I have just started looking over the API, trying to get a feel for how I might use it. One suggestion I might have right off the bat is to move any fields that are not normally writable to a property (with only a get) supplied.
Code:
public bool Connected = false; Code:
private bool connected = false;
public bool Connected{
get{
return connected;
}
}
It looks like the cbP2140 struct is all read only values, so it seems like all of these would like to be get only properties. To achieve that, you would need to add a method that takes the received data and sets everything (preferably) or makes the set part internal. For the paramP2140 you could have the setter for each field set a bit indicating that it has been changed. You might also consider changing the Mode field to an enum, maybe something like: Code:
enum Mode {
u = 117,
User = 117,
b=98,
Bootloader = 98,
x=120,
NotConnected=120
};
These are of course, just suggestions, and I think the SDK seems perfectly usable as is and makes me very happy I bought a P2140 and external PSU instead of an integrated device. I haven't had the time to actually get down and start working on any software that uses this yet, but I am excited about the posssibilities. The first thing that comes to mind is of course making a skinnable psuimon clone. I would also like to create an app that monitors the ignition state and kicks off some tasks when the ignition goes off, then (once they complete) start the shutdown process. |
|
#3
|
||||
|
||||
|
zPilott,
Excellent feedback. No I just need to figure out how to do the stuff you suggested... . I'm sort of a newbie C# programmer. Seriously, I understand what you are saying and agree that it would be a good idea. I'll give it a shot (a bit later).I'm glad to see your excitement about writing apps. I have been hoping folks would jump on this opportunity. I'd love to see some sort of integration with an existing front end. Let me know if you run into any problems. And thanks for the feedback. |
|
#4
|
|||
|
|||
|
Is there a quick howto on using this api? I can't seem to find "mpusbapi.dll" where do I get this dll and once I have it where do I put it?
|
|
#5
|
|||
|
|||
|
I think the mpusbapi.dll is included with psumoni. It is probably easiest to just put it in the same directory as your application, but you can also put it anywhere in your path. The help files included seem pretty complete and you might want to look at the demo application included in the sdk for help getting started.
|
|
#6
|
|||
|
|||
|
is there a way to emulate a 2140 so we can program against it without physically having a unit connected ? A feature request for the future I guess.
Also, I'd like to add history and long term graphs to psumoni, is there a chance you would release the source for psumoni so we don't have to rewrite all from scratch ? Sam |
|
#7
|
||||
|
||||
|
Quote:
Quote:
|
|
#8
|
|||
|
|||
|
I understand about releasing the code - no problem, just worth asking before I start doing it as a side project. $700 tools - for visual studio or some 3rd party stuff ?
For development I will be testing the eltima.com usb to ethernet package. . . this will let me bring my 2140 USB port to another machine that I have all my development software on. I'll report back to let you know how it works out. Sam |
|
#9
|
|||
|
|||
|
great to see that an api/sdk was released.
Now someone needs to hack together a .dll for frontend integretion. |
|
#10
|
|||
|
|||
|
Quote:
That + Fusion Brain ( Link Here ) Would make for an AWESOME setup. |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|