{"id":4153,"date":"2019-11-21T11:56:01","date_gmt":"2019-11-21T11:56:01","guid":{"rendered":"https:\/\/grodansparadis.com\/wordpress\/?p=4153"},"modified":"2019-12-11T13:09:21","modified_gmt":"2019-12-11T13:09:21","slug":"new-vscp-level-ii-driver-interface","status":"publish","type":"post","link":"https:\/\/grodansparadis.com\/wordpress\/?p=4153","title":{"rendered":"New #VSCP Level II driver interface"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"4025\" data-permalink=\"https:\/\/grodansparadis.com\/wordpress\/?attachment_id=4025\" data-orig-file=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2019\/06\/vscp_new_v2.png?fit=800%2C720&amp;ssl=1\" data-orig-size=\"800,720\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"vscp_new_v2\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2019\/06\/vscp_new_v2.png?fit=580%2C522&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2019\/06\/vscp_new_v2.png?resize=164%2C147&#038;ssl=1\" alt=\"\" class=\"wp-image-4025\" width=\"164\" height=\"147\" srcset=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2019\/06\/vscp_new_v2.png?w=800&amp;ssl=1 800w, https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2019\/06\/vscp_new_v2.png?resize=300%2C270&amp;ssl=1 300w, https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2019\/06\/vscp_new_v2.png?resize=768%2C691&amp;ssl=1 768w\" sizes=\"auto, (max-width: 164px) 100vw, 164px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The driver interface for Level II drivers will change for the upcoming 14.0.0 release. In previous versions the message passing has been done through the tcp\/ip interface.  This is no longer used (will still be used by Level III drivers). <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The interface a driver maker  has to implement is very simple and looks like this<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\n\/\/ Open connection\nlong VSCPOpen( const char *pPathConfig, const unsigned char*pguid );\n\n\/\/ Close connection\nint VSCPClose( long handle );\n\n\/\/ Write event\nint VSCPWrite( long handle, const vscpEvent *pEvent, long timeout );\n\n\/\/ Read event\nint VSCPRead( long handle, vscpEvent *pEvent, unsigned long timeout );\n\n\/\/ Get driver version MSB = major, LSB = build with minor\/release in between\nunsigned long VSCPGetVersion(  void );\n\n\/\/ Get vendor string describing driver maker\nconst char *VSCPGetVendorString( void );\n<\/pre><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">I think it is pretty selfexplanatory. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">All Level II driver now must have a unique GUID assign to them. Configuration is<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><pre class=\"brush: xml; title: ; notranslate\" title=\"\">\n&amp;lt;driver enable=&quot;true&quot;     \n        name=&quot;driver-name&quot;     \n        path-driver=&quot;\/usr\/lib\/x86_64-linux-gnu\/vscpl2drv-driver-name1.so&quot;     \n        path-config=&quot;\/var\/lib\/vscpl2drv-driver-name\/drv.xml&quot;       \n        guid=&quot;FF:FF:FF:FF:FF:FF:FF:FC:88:99:AA:BB:CC:DD:EE:FF&quot; \n&amp;lt;\/driver&amp;gt;\n<\/pre><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Worth to note here is that driver now by default will be installed to <strong>\/usr\/lib\/x86_64-linux-gnu\/<\/strong> and <strong>\/usr\/lib\/x86_32-linux-gnu\/ <\/strong>so one can have 32-bit and 64-bit drivers installed on a system at the same time. We by this adopt to Debian roles used in deb packages.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Also driver names will end with the major version. So a a level II driver &#8220;automation&#8221; will be <strong>vscpl2drv-automation1<\/strong>. Also, drivers will comply to the Linux library installation schema used on Linux so they will be installed with the full version for example <strong>vscpl2drv-automation1.so.1.1.1<\/strong> but links will be created for <strong>vscpl2drv-automation1.so.1.1<\/strong>, <strong>vscpl2drv-automation1.so.1<\/strong> and <strong>vscpl2drv-automation1.so<\/strong> so drivers can be addressed as before.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you make driver please use this schema. In the same way use <strong>vscpl1drv-<\/strong> as prefix for level I driver.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>name<\/strong> is a system unique name for the driver.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>path-driver<\/strong> gives the path to the driver as expected.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>path-config<\/strong> is a path to a configuration file for a driver. Normally this file should be in xml format. The location for the configuration file can be anywhere but recommended is <strong>\/var\/lib\/vscpl2drv-driver-name\/ <\/strong>for a driver that can be configured on the fly and <strong>\/etc\/vscp<\/strong> for a driver that are static. The later being the safest place.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>guid<\/strong> is a system unique GUID for the driver. This GUID must be set and it must be valid. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">New for level II drivers is that they will be able to be configured on the fly and be interacted with through the web interface, websockets and tcp\/ip interface. One can therefore easily set up configuration pages etc.  More on that later. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For a sample of the new futures and a base for your own projects check the  <a href=\"https:\/\/github.com\/grodansparadis\/vscpl2drv-automation\">vscpl2drv-automation<\/a> driver. This driver implements the automation functionality that was previously integrated into the VSCP daemon. Tables, DM, remote variables, udp, multicast are other functionality that is moved out to drivers with the upcoming 14.0.0 version.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A lot of new functionality is demonstrated in the vscpl2drv-automation. Save and load for example that save\/load the current configuration. Also all parameters are possible to edit\/change when the driver is loaded and alive in a system.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Some parameters may still be changed so look at tis as somewhat preliminary information.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The driver interface for Level II drivers will change for the upcoming 14.0.0 release. In previous versions the message passing has been done through the tcp\/ip interface. This is no longer used (will still be used by Level III drivers). The interface a driver maker has to implement is very simple and looks like this [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[54,12,13],"tags":[],"class_list":["post-4153","post","type-post","status-publish","format-standard","hentry","category-development","category-general","category-vscp"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p4raCZ-14Z","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/grodansparadis.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/4153","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/grodansparadis.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/grodansparadis.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/grodansparadis.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/grodansparadis.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4153"}],"version-history":[{"count":4,"href":"https:\/\/grodansparadis.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/4153\/revisions"}],"predecessor-version":[{"id":4179,"href":"https:\/\/grodansparadis.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/4153\/revisions\/4179"}],"wp:attachment":[{"href":"https:\/\/grodansparadis.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4153"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/grodansparadis.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4153"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/grodansparadis.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4153"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}