├── .gitignore ├── .npmignore ├── .travis.yml ├── README.md ├── binding.gyp ├── dev-env.nix ├── node-packages.nix ├── package.json ├── spec ├── logo.spec.coffee ├── nodave.spec.coffee └── plc.spec.coffee └── src ├── addon.cc ├── libnodave ├── libnodave.gyp ├── log2.h ├── nodave.c ├── nodave.h └── nodavesimple.h ├── logo.coffee ├── node_nodave.cc ├── node_nodave.h └── plc.coffee /.gitignore: -------------------------------------------------------------------------------- 1 | *.so 2 | *.swp 3 | node_modules/ 4 | build/ 5 | lib/ 6 | npm-debug.log 7 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | build/ 3 | *.swp 4 | *.tmp 5 | .directory 6 | *.coffee 7 | coverage/ 8 | test.cc 9 | spec/ 10 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.10" 4 | - "0.12" 5 | - "4" 6 | - "5" 7 | - "6" 8 | - "7" 9 | env: 10 | - CXX=g++-4.8 11 | addons: 12 | apt: 13 | sources: 14 | - ubuntu-toolchain-r-test 15 | packages: 16 | - g++-4.8 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # node-plc 2 | 3 | Node.js module to communicate with PLCs. 4 | At the moment only the Siemens LOGO! PLC (`0BA7`and `0BA8`) is supported. 5 | 6 | [![Build Status](https://secure.travis-ci.org/flosse/node-plc.svg)](http://travis-ci.org/flosse/node-plc) 7 | [![Dependency Status](https://gemnasium.com/flosse/node-plc.svg)](https://gemnasium.com/flosse/node-plc) 8 | [![NPM version](https://badge.fury.io/js/plc.svg)](http://badge.fury.io/js/plc) 9 | 10 | ## Usage 11 | 12 | ```shell 13 | npm install --save plc 14 | ``` 15 | 16 | ```javascript 17 | var plc = require("plc"); 18 | ``` 19 | 20 | ### Logo class 21 | 22 | ```javascript 23 | 24 | var myLogo = new plc.Logo("192.168.0.1", { 25 | markers: 6, // default is 8 26 | inputs: 4, // default is 8 27 | timeout: 500 // socket timeout in milliseconds 28 | }); 29 | 30 | myLogo.on("error", function(err){ 31 | console.error(err.message); 32 | }); 33 | 34 | myLogo.on("connect", function(){ 35 | 36 | var result = myLogo.getInputs(); 37 | if (result instanceof Error){ 38 | return console.error(result.message); 39 | } 40 | console.log(result); // [true, false, false, true, false, true] 41 | 42 | result = myLogo.getMarkers(); 43 | if (result instanceof Error){ 44 | return console.error(result.message); 45 | } 46 | console.log(result); // [true, false, true, true] 47 | 48 | result = myLogo.setMarker(2); 49 | if (result instanceof Error){ 50 | return console.error(result.message); 51 | } 52 | 53 | myLogo.disconnect(); 54 | }); 55 | 56 | myLogo.connect(); 57 | ``` 58 | 59 | ### Simulation 60 | 61 | ```javascript 62 | var plc = require("plc"); 63 | 64 | var myVirtualLogo = new plc.Logo("192.168.0.1", { simulate: true }); 65 | 66 | myLogo.on("connect", function(){ 67 | 68 | /** 69 | * Since we cannot manipulate the inputs of a real PLCs 70 | * there is no "setInput" method. But within the simulation 71 | * mode we can use the special methods "setSimulatedInput" 72 | * and "clearSimulatedInput". 73 | */ 74 | 75 | myVirtualLogo.setSimulatedInput(2); 76 | myLogo.getInput(2); // true 77 | myVirtualLogo.clearSimulatedInput(2); 78 | myLogo.getInput(2); // false 79 | 80 | /** 81 | * Markers can be used as usual. 82 | */ 83 | 84 | myVirtualLogo.setMarker(1); 85 | myVirtualLogo.getMarker(1); // true 86 | myVirtualLogo.clearMarker(1); 87 | myVirtualLogo.getMarker(1); // false 88 | 89 | }); 90 | 91 | myVirtualLogo.connect(); 92 | ``` 93 | 94 | ### Comfort features 95 | 96 | The LOGO! can be configured with state and action schemata. 97 | A states could be described like this: 98 | 99 | ```javascript 100 | var myStates = { 101 | stateOne: { input: 0 }, 102 | stateTwo: { marker: 2 }, 103 | stateThree: { input: 2 } 104 | }; 105 | ``` 106 | 107 | An action consists of an array with defined desired states: 108 | 109 | ```javascript 110 | var actions = { 111 | actionOne: 112 | [ 113 | { type: 'clear', marker: 1 }, 114 | { type: 'set', marker: 3 } 115 | ], 116 | actionTwo: 117 | [ { type: 'set', marker: 2 } ], 118 | actionThree: 119 | [ { type: 'alias', actions: ['actionOne','actionTwo'] } ] 120 | }; 121 | ``` 122 | 123 | This is a full example: 124 | 125 | ```javascript 126 | var config = { 127 | timeout: 500 // connection timeout 128 | interval: 250 // read state interval 129 | states: { 130 | x: { input: 0 }, 131 | y: { input: 2 }, 132 | foo: { marker: 0 }, 133 | bar: { input: 1 } 134 | actions: { 135 | switchOne: 136 | [ 137 | { type: 'set', marker: 3 } 138 | ], 139 | switchTwo: 140 | [ 141 | { type: 'set', marker: 1 }, 142 | { type: 'alias', switches: ['switchOne'] } 143 | ] 144 | } 145 | } 146 | }; 147 | 148 | var dev1 = new Device("192.168.0.201", config); 149 | 150 | dev1.on("connect", function(){ 151 | console.log("Device 1 connected"); 152 | }); 153 | 154 | dev1.on("timeout", function(){ 155 | console.log("Device 1 connection timeout occoured"); 156 | }); 157 | 158 | dev1.on("disconnect", function(){ 159 | console.log("Device 1 disconnected"); 160 | }); 161 | 162 | dev1.on("error", function(err){ 163 | console.error("something went wrong: ", err.message); 164 | }); 165 | 166 | dev.on('state-change', function(state){ 167 | console.log(state); 168 | // { x: true, y: false, foo: true, bar: false } 169 | }); 170 | 171 | dev1.connect(); 172 | dev1.startWatching(); 173 | 174 | // ... 175 | 176 | dev1.stopWatching(); 177 | dev1.disconnect(); 178 | ``` 179 | 180 | ### API 181 | 182 | #### Constructor 183 | 184 | ```javascript 185 | new require("plc").Logo(ipAddress, options); 186 | ``` 187 | 188 | Following options are available 189 | 190 | - `inputs` - number of used inputs 191 | - `markers` - number of used markers 192 | - `simulate` - simulation mode 193 | - `timeout` - the socket timeout 194 | 195 | #### Properties 196 | 197 | - `ip` 198 | - `isConnected` 199 | 200 | #### Methods 201 | 202 | - `connect()` 203 | - `disconnect()` 204 | - `setMarker(nr)` 205 | - `clearMarker(nr)` 206 | - `getMarker(nr)` 207 | - `getMarkers()` 208 | - `getInput(nr)` 209 | - `getInputs()` 210 | - `setSimulatedInput(nr)` 211 | - `clearSimulatedInput(nr)` 212 | - `getState()` 213 | - `setSimulatedState(stateName, value)` 214 | - `setVirtualState(stateName, value)` 215 | - `triggerAction(action)` 216 | - `startWatching` 217 | - `stopWatching` 218 | 219 | #### Events 220 | 221 | - `error` 222 | - `connect` 223 | - `disconnect` 224 | - `timeout` 225 | - `state` 226 | - `state-change` 227 | 228 | ## Test 229 | 230 | ``` 231 | npm test 232 | ``` 233 | 234 | ## License 235 | 236 | This project is licensed under the LGPL license. 237 | -------------------------------------------------------------------------------- /binding.gyp: -------------------------------------------------------------------------------- 1 | { 2 | "targets":[ 3 | { 4 | "target_name":"addon", 5 | "sources":["src/addon.cc", "src/node_nodave.cc"], 6 | "include_dirs": [ 7 | " {}; 3 | stdenv = pkgs.stdenv; 4 | lib = pkgs.lib; 5 | 6 | nodePackages = pkgs.nodePackages.override { 7 | self = nodePackages; 8 | generated = ./node-packages.nix; 9 | }; 10 | 11 | in rec { 12 | devEnv = stdenv.mkDerivation rec { 13 | name = "dev-env"; 14 | src = ./.; 15 | buildInputs = with nodePackages; [ 16 | pkgs.utillinux 17 | pkgs.python 18 | stdenv 19 | pkgs.nodejs 20 | nan 21 | bindings 22 | bits 23 | chai 24 | mocha 25 | node-gyp 26 | coffee-script 27 | ]; 28 | }; 29 | } 30 | -------------------------------------------------------------------------------- /node-packages.nix: -------------------------------------------------------------------------------- 1 | { self, fetchurl, fetchgit ? null, lib }: 2 | 3 | { 4 | by-spec."abbrev"."1" = 5 | self.by-version."abbrev"."1.0.5"; 6 | by-version."abbrev"."1.0.5" = lib.makeOverridable self.buildNodePackage { 7 | name = "abbrev-1.0.5"; 8 | bin = false; 9 | src = [ 10 | (fetchurl { 11 | url = "http://registry.npmjs.org/abbrev/-/abbrev-1.0.5.tgz"; 12 | name = "abbrev-1.0.5.tgz"; 13 | sha1 = "5d8257bd9ebe435e698b2fa431afde4fe7b10b03"; 14 | }) 15 | ]; 16 | buildInputs = 17 | (self.nativeDeps."abbrev" or []); 18 | deps = { 19 | }; 20 | peerDependencies = [ 21 | ]; 22 | passthru.names = [ "abbrev" ]; 23 | }; 24 | by-spec."ansi"."^0.3.0" = 25 | self.by-version."ansi"."0.3.0"; 26 | by-version."ansi"."0.3.0" = lib.makeOverridable self.buildNodePackage { 27 | name = "ansi-0.3.0"; 28 | bin = false; 29 | src = [ 30 | (fetchurl { 31 | url = "http://registry.npmjs.org/ansi/-/ansi-0.3.0.tgz"; 32 | name = "ansi-0.3.0.tgz"; 33 | sha1 = "74b2f1f187c8553c7f95015bcb76009fb43d38e0"; 34 | }) 35 | ]; 36 | buildInputs = 37 | (self.nativeDeps."ansi" or []); 38 | deps = { 39 | }; 40 | peerDependencies = [ 41 | ]; 42 | passthru.names = [ "ansi" ]; 43 | }; 44 | by-spec."ansi"."~0.3.0" = 45 | self.by-version."ansi"."0.3.0"; 46 | by-spec."ansi-regex"."^1.0.0" = 47 | self.by-version."ansi-regex"."1.1.1"; 48 | by-version."ansi-regex"."1.1.1" = lib.makeOverridable self.buildNodePackage { 49 | name = "ansi-regex-1.1.1"; 50 | bin = false; 51 | src = [ 52 | (fetchurl { 53 | url = "http://registry.npmjs.org/ansi-regex/-/ansi-regex-1.1.1.tgz"; 54 | name = "ansi-regex-1.1.1.tgz"; 55 | sha1 = "41c847194646375e6a1a5d10c3ca054ef9fc980d"; 56 | }) 57 | ]; 58 | buildInputs = 59 | (self.nativeDeps."ansi-regex" or []); 60 | deps = { 61 | }; 62 | peerDependencies = [ 63 | ]; 64 | passthru.names = [ "ansi-regex" ]; 65 | }; 66 | by-spec."ansi-regex"."^1.1.0" = 67 | self.by-version."ansi-regex"."1.1.1"; 68 | by-spec."ansi-styles"."^2.0.1" = 69 | self.by-version."ansi-styles"."2.0.1"; 70 | by-version."ansi-styles"."2.0.1" = lib.makeOverridable self.buildNodePackage { 71 | name = "ansi-styles-2.0.1"; 72 | bin = false; 73 | src = [ 74 | (fetchurl { 75 | url = "http://registry.npmjs.org/ansi-styles/-/ansi-styles-2.0.1.tgz"; 76 | name = "ansi-styles-2.0.1.tgz"; 77 | sha1 = "b033f57f93e2d28adeb8bc11138fa13da0fd20a3"; 78 | }) 79 | ]; 80 | buildInputs = 81 | (self.nativeDeps."ansi-styles" or []); 82 | deps = { 83 | }; 84 | peerDependencies = [ 85 | ]; 86 | passthru.names = [ "ansi-styles" ]; 87 | }; 88 | by-spec."are-we-there-yet"."~1.0.0" = 89 | self.by-version."are-we-there-yet"."1.0.4"; 90 | by-version."are-we-there-yet"."1.0.4" = lib.makeOverridable self.buildNodePackage { 91 | name = "are-we-there-yet-1.0.4"; 92 | bin = false; 93 | src = [ 94 | (fetchurl { 95 | url = "http://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.0.4.tgz"; 96 | name = "are-we-there-yet-1.0.4.tgz"; 97 | sha1 = "527fe389f7bcba90806106b99244eaa07e886f85"; 98 | }) 99 | ]; 100 | buildInputs = 101 | (self.nativeDeps."are-we-there-yet" or []); 102 | deps = { 103 | "delegates-0.1.0" = self.by-version."delegates"."0.1.0"; 104 | "readable-stream-1.1.13" = self.by-version."readable-stream"."1.1.13"; 105 | }; 106 | peerDependencies = [ 107 | ]; 108 | passthru.names = [ "are-we-there-yet" ]; 109 | }; 110 | by-spec."asn1"."0.1.11" = 111 | self.by-version."asn1"."0.1.11"; 112 | by-version."asn1"."0.1.11" = lib.makeOverridable self.buildNodePackage { 113 | name = "asn1-0.1.11"; 114 | bin = false; 115 | src = [ 116 | (fetchurl { 117 | url = "http://registry.npmjs.org/asn1/-/asn1-0.1.11.tgz"; 118 | name = "asn1-0.1.11.tgz"; 119 | sha1 = "559be18376d08a4ec4dbe80877d27818639b2df7"; 120 | }) 121 | ]; 122 | buildInputs = 123 | (self.nativeDeps."asn1" or []); 124 | deps = { 125 | }; 126 | peerDependencies = [ 127 | ]; 128 | passthru.names = [ "asn1" ]; 129 | }; 130 | by-spec."assert-plus"."^0.1.5" = 131 | self.by-version."assert-plus"."0.1.5"; 132 | by-version."assert-plus"."0.1.5" = lib.makeOverridable self.buildNodePackage { 133 | name = "assert-plus-0.1.5"; 134 | bin = false; 135 | src = [ 136 | (fetchurl { 137 | url = "http://registry.npmjs.org/assert-plus/-/assert-plus-0.1.5.tgz"; 138 | name = "assert-plus-0.1.5.tgz"; 139 | sha1 = "ee74009413002d84cec7219c6ac811812e723160"; 140 | }) 141 | ]; 142 | buildInputs = 143 | (self.nativeDeps."assert-plus" or []); 144 | deps = { 145 | }; 146 | peerDependencies = [ 147 | ]; 148 | passthru.names = [ "assert-plus" ]; 149 | }; 150 | by-spec."assertion-error"."1.0.0" = 151 | self.by-version."assertion-error"."1.0.0"; 152 | by-version."assertion-error"."1.0.0" = lib.makeOverridable self.buildNodePackage { 153 | name = "assertion-error-1.0.0"; 154 | bin = false; 155 | src = [ 156 | (fetchurl { 157 | url = "http://registry.npmjs.org/assertion-error/-/assertion-error-1.0.0.tgz"; 158 | name = "assertion-error-1.0.0.tgz"; 159 | sha1 = "c7f85438fdd466bc7ca16ab90c81513797a5d23b"; 160 | }) 161 | ]; 162 | buildInputs = 163 | (self.nativeDeps."assertion-error" or []); 164 | deps = { 165 | }; 166 | peerDependencies = [ 167 | ]; 168 | passthru.names = [ "assertion-error" ]; 169 | }; 170 | by-spec."async"."~0.9.0" = 171 | self.by-version."async"."0.9.0"; 172 | by-version."async"."0.9.0" = lib.makeOverridable self.buildNodePackage { 173 | name = "async-0.9.0"; 174 | bin = false; 175 | src = [ 176 | (fetchurl { 177 | url = "http://registry.npmjs.org/async/-/async-0.9.0.tgz"; 178 | name = "async-0.9.0.tgz"; 179 | sha1 = "ac3613b1da9bed1b47510bb4651b8931e47146c7"; 180 | }) 181 | ]; 182 | buildInputs = 183 | (self.nativeDeps."async" or []); 184 | deps = { 185 | }; 186 | peerDependencies = [ 187 | ]; 188 | passthru.names = [ "async" ]; 189 | }; 190 | by-spec."aws-sign2"."~0.5.0" = 191 | self.by-version."aws-sign2"."0.5.0"; 192 | by-version."aws-sign2"."0.5.0" = lib.makeOverridable self.buildNodePackage { 193 | name = "aws-sign2-0.5.0"; 194 | bin = false; 195 | src = [ 196 | (fetchurl { 197 | url = "http://registry.npmjs.org/aws-sign2/-/aws-sign2-0.5.0.tgz"; 198 | name = "aws-sign2-0.5.0.tgz"; 199 | sha1 = "c57103f7a17fc037f02d7c2e64b602ea223f7d63"; 200 | }) 201 | ]; 202 | buildInputs = 203 | (self.nativeDeps."aws-sign2" or []); 204 | deps = { 205 | }; 206 | peerDependencies = [ 207 | ]; 208 | passthru.names = [ "aws-sign2" ]; 209 | }; 210 | by-spec."balanced-match"."^0.2.0" = 211 | self.by-version."balanced-match"."0.2.0"; 212 | by-version."balanced-match"."0.2.0" = lib.makeOverridable self.buildNodePackage { 213 | name = "balanced-match-0.2.0"; 214 | bin = false; 215 | src = [ 216 | (fetchurl { 217 | url = "http://registry.npmjs.org/balanced-match/-/balanced-match-0.2.0.tgz"; 218 | name = "balanced-match-0.2.0.tgz"; 219 | sha1 = "38f6730c03aab6d5edbb52bd934885e756d71674"; 220 | }) 221 | ]; 222 | buildInputs = 223 | (self.nativeDeps."balanced-match" or []); 224 | deps = { 225 | }; 226 | peerDependencies = [ 227 | ]; 228 | passthru.names = [ "balanced-match" ]; 229 | }; 230 | by-spec."bindings"."^1.2.1" = 231 | self.by-version."bindings"."1.2.1"; 232 | by-version."bindings"."1.2.1" = lib.makeOverridable self.buildNodePackage { 233 | name = "bindings-1.2.1"; 234 | bin = false; 235 | src = [ 236 | (fetchurl { 237 | url = "http://registry.npmjs.org/bindings/-/bindings-1.2.1.tgz"; 238 | name = "bindings-1.2.1.tgz"; 239 | sha1 = "14ad6113812d2d37d72e67b4cacb4bb726505f11"; 240 | }) 241 | ]; 242 | buildInputs = 243 | (self.nativeDeps."bindings" or []); 244 | deps = { 245 | }; 246 | peerDependencies = [ 247 | ]; 248 | passthru.names = [ "bindings" ]; 249 | }; 250 | "bindings" = self.by-version."bindings"."1.2.1"; 251 | by-spec."bits"."~0.1.1" = 252 | self.by-version."bits"."0.1.1"; 253 | by-version."bits"."0.1.1" = lib.makeOverridable self.buildNodePackage { 254 | name = "bits-0.1.1"; 255 | bin = false; 256 | src = [ 257 | (fetchurl { 258 | url = "http://registry.npmjs.org/bits/-/bits-0.1.1.tgz"; 259 | name = "bits-0.1.1.tgz"; 260 | sha1 = "7082eb8b7bdf12e47b0a8cf8f7ad3af4e7053a96"; 261 | }) 262 | ]; 263 | buildInputs = 264 | (self.nativeDeps."bits" or []); 265 | deps = { 266 | }; 267 | peerDependencies = [ 268 | ]; 269 | passthru.names = [ "bits" ]; 270 | }; 271 | "bits" = self.by-version."bits"."0.1.1"; 272 | by-spec."bl"."~0.9.0" = 273 | self.by-version."bl"."0.9.4"; 274 | by-version."bl"."0.9.4" = lib.makeOverridable self.buildNodePackage { 275 | name = "bl-0.9.4"; 276 | bin = false; 277 | src = [ 278 | (fetchurl { 279 | url = "http://registry.npmjs.org/bl/-/bl-0.9.4.tgz"; 280 | name = "bl-0.9.4.tgz"; 281 | sha1 = "4702ddf72fbe0ecd82787c00c113aea1935ad0e7"; 282 | }) 283 | ]; 284 | buildInputs = 285 | (self.nativeDeps."bl" or []); 286 | deps = { 287 | "readable-stream-1.0.33" = self.by-version."readable-stream"."1.0.33"; 288 | }; 289 | peerDependencies = [ 290 | ]; 291 | passthru.names = [ "bl" ]; 292 | }; 293 | by-spec."block-stream"."*" = 294 | self.by-version."block-stream"."0.0.7"; 295 | by-version."block-stream"."0.0.7" = lib.makeOverridable self.buildNodePackage { 296 | name = "block-stream-0.0.7"; 297 | bin = false; 298 | src = [ 299 | (fetchurl { 300 | url = "http://registry.npmjs.org/block-stream/-/block-stream-0.0.7.tgz"; 301 | name = "block-stream-0.0.7.tgz"; 302 | sha1 = "9088ab5ae1e861f4d81b176b4a8046080703deed"; 303 | }) 304 | ]; 305 | buildInputs = 306 | (self.nativeDeps."block-stream" or []); 307 | deps = { 308 | "inherits-2.0.1" = self.by-version."inherits"."2.0.1"; 309 | }; 310 | peerDependencies = [ 311 | ]; 312 | passthru.names = [ "block-stream" ]; 313 | }; 314 | by-spec."bluebird"."^2.9.21" = 315 | self.by-version."bluebird"."2.9.24"; 316 | by-version."bluebird"."2.9.24" = lib.makeOverridable self.buildNodePackage { 317 | name = "bluebird-2.9.24"; 318 | bin = false; 319 | src = [ 320 | (fetchurl { 321 | url = "http://registry.npmjs.org/bluebird/-/bluebird-2.9.24.tgz"; 322 | name = "bluebird-2.9.24.tgz"; 323 | sha1 = "14a2e75f0548323dc35aa440d92007ca154e967c"; 324 | }) 325 | ]; 326 | buildInputs = 327 | (self.nativeDeps."bluebird" or []); 328 | deps = { 329 | }; 330 | peerDependencies = [ 331 | ]; 332 | passthru.names = [ "bluebird" ]; 333 | }; 334 | by-spec."boom"."2.x.x" = 335 | self.by-version."boom"."2.7.0"; 336 | by-version."boom"."2.7.0" = lib.makeOverridable self.buildNodePackage { 337 | name = "boom-2.7.0"; 338 | bin = false; 339 | src = [ 340 | (fetchurl { 341 | url = "http://registry.npmjs.org/boom/-/boom-2.7.0.tgz"; 342 | name = "boom-2.7.0.tgz"; 343 | sha1 = "47c6c7f62dc6d68742a75c4010b035c62615d265"; 344 | }) 345 | ]; 346 | buildInputs = 347 | (self.nativeDeps."boom" or []); 348 | deps = { 349 | "hoek-2.12.0" = self.by-version."hoek"."2.12.0"; 350 | }; 351 | peerDependencies = [ 352 | ]; 353 | passthru.names = [ "boom" ]; 354 | }; 355 | by-spec."brace-expansion"."^1.0.0" = 356 | self.by-version."brace-expansion"."1.1.0"; 357 | by-version."brace-expansion"."1.1.0" = lib.makeOverridable self.buildNodePackage { 358 | name = "brace-expansion-1.1.0"; 359 | bin = false; 360 | src = [ 361 | (fetchurl { 362 | url = "http://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.0.tgz"; 363 | name = "brace-expansion-1.1.0.tgz"; 364 | sha1 = "c9b7d03c03f37bc704be100e522b40db8f6cfcd9"; 365 | }) 366 | ]; 367 | buildInputs = 368 | (self.nativeDeps."brace-expansion" or []); 369 | deps = { 370 | "balanced-match-0.2.0" = self.by-version."balanced-match"."0.2.0"; 371 | "concat-map-0.0.1" = self.by-version."concat-map"."0.0.1"; 372 | }; 373 | peerDependencies = [ 374 | ]; 375 | passthru.names = [ "brace-expansion" ]; 376 | }; 377 | by-spec."caseless"."~0.9.0" = 378 | self.by-version."caseless"."0.9.0"; 379 | by-version."caseless"."0.9.0" = lib.makeOverridable self.buildNodePackage { 380 | name = "caseless-0.9.0"; 381 | bin = false; 382 | src = [ 383 | (fetchurl { 384 | url = "http://registry.npmjs.org/caseless/-/caseless-0.9.0.tgz"; 385 | name = "caseless-0.9.0.tgz"; 386 | sha1 = "b7b65ce6bf1413886539cfd533f0b30effa9cf88"; 387 | }) 388 | ]; 389 | buildInputs = 390 | (self.nativeDeps."caseless" or []); 391 | deps = { 392 | }; 393 | peerDependencies = [ 394 | ]; 395 | passthru.names = [ "caseless" ]; 396 | }; 397 | by-spec."chai"."~2.2.0" = 398 | self.by-version."chai"."2.2.0"; 399 | by-version."chai"."2.2.0" = lib.makeOverridable self.buildNodePackage { 400 | name = "chai-2.2.0"; 401 | bin = false; 402 | src = [ 403 | (fetchurl { 404 | url = "http://registry.npmjs.org/chai/-/chai-2.2.0.tgz"; 405 | name = "chai-2.2.0.tgz"; 406 | sha1 = "d21135623bd393ad4702d94536eca482ad78d01d"; 407 | }) 408 | ]; 409 | buildInputs = 410 | (self.nativeDeps."chai" or []); 411 | deps = { 412 | "assertion-error-1.0.0" = self.by-version."assertion-error"."1.0.0"; 413 | "deep-eql-0.1.3" = self.by-version."deep-eql"."0.1.3"; 414 | }; 415 | peerDependencies = [ 416 | ]; 417 | passthru.names = [ "chai" ]; 418 | }; 419 | "chai" = self.by-version."chai"."2.2.0"; 420 | by-spec."chalk"."^1.0.0" = 421 | self.by-version."chalk"."1.0.0"; 422 | by-version."chalk"."1.0.0" = lib.makeOverridable self.buildNodePackage { 423 | name = "chalk-1.0.0"; 424 | bin = false; 425 | src = [ 426 | (fetchurl { 427 | url = "http://registry.npmjs.org/chalk/-/chalk-1.0.0.tgz"; 428 | name = "chalk-1.0.0.tgz"; 429 | sha1 = "b3cf4ed0ff5397c99c75b8f679db2f52831f96dc"; 430 | }) 431 | ]; 432 | buildInputs = 433 | (self.nativeDeps."chalk" or []); 434 | deps = { 435 | "ansi-styles-2.0.1" = self.by-version."ansi-styles"."2.0.1"; 436 | "escape-string-regexp-1.0.3" = self.by-version."escape-string-regexp"."1.0.3"; 437 | "has-ansi-1.0.3" = self.by-version."has-ansi"."1.0.3"; 438 | "strip-ansi-2.0.1" = self.by-version."strip-ansi"."2.0.1"; 439 | "supports-color-1.3.1" = self.by-version."supports-color"."1.3.1"; 440 | }; 441 | peerDependencies = [ 442 | ]; 443 | passthru.names = [ "chalk" ]; 444 | }; 445 | by-spec."coffee-script"."^1.9.1" = 446 | self.by-version."coffee-script"."1.9.2"; 447 | by-version."coffee-script"."1.9.2" = lib.makeOverridable self.buildNodePackage { 448 | name = "coffee-script-1.9.2"; 449 | bin = true; 450 | src = [ 451 | (fetchurl { 452 | url = "http://registry.npmjs.org/coffee-script/-/coffee-script-1.9.2.tgz"; 453 | name = "coffee-script-1.9.2.tgz"; 454 | sha1 = "2da4b663c61c6d1d851788aa31f941fc7b63edf3"; 455 | }) 456 | ]; 457 | buildInputs = 458 | (self.nativeDeps."coffee-script" or []); 459 | deps = { 460 | }; 461 | peerDependencies = [ 462 | ]; 463 | passthru.names = [ "coffee-script" ]; 464 | }; 465 | by-spec."coffee-script"."~1.9.1" = 466 | self.by-version."coffee-script"."1.9.2"; 467 | "coffee-script" = self.by-version."coffee-script"."1.9.2"; 468 | by-spec."coffeelint"."^1.9.3" = 469 | self.by-version."coffeelint"."1.9.3"; 470 | by-version."coffeelint"."1.9.3" = lib.makeOverridable self.buildNodePackage { 471 | name = "coffeelint-1.9.3"; 472 | bin = true; 473 | src = [ 474 | (fetchurl { 475 | url = "http://registry.npmjs.org/coffeelint/-/coffeelint-1.9.3.tgz"; 476 | name = "coffeelint-1.9.3.tgz"; 477 | sha1 = "e47c40e41fa2d89fda9a443b5aeaefabf9731713"; 478 | }) 479 | ]; 480 | buildInputs = 481 | (self.nativeDeps."coffeelint" or []); 482 | deps = { 483 | "coffee-script-1.9.2" = self.by-version."coffee-script"."1.9.2"; 484 | "glob-4.5.3" = self.by-version."glob"."4.5.3"; 485 | "ignore-2.2.15" = self.by-version."ignore"."2.2.15"; 486 | "optimist-0.6.1" = self.by-version."optimist"."0.6.1"; 487 | "resolve-0.6.3" = self.by-version."resolve"."0.6.3"; 488 | }; 489 | peerDependencies = [ 490 | ]; 491 | passthru.names = [ "coffeelint" ]; 492 | }; 493 | "coffeelint" = self.by-version."coffeelint"."1.9.3"; 494 | by-spec."combined-stream"."~0.0.4" = 495 | self.by-version."combined-stream"."0.0.7"; 496 | by-version."combined-stream"."0.0.7" = lib.makeOverridable self.buildNodePackage { 497 | name = "combined-stream-0.0.7"; 498 | bin = false; 499 | src = [ 500 | (fetchurl { 501 | url = "http://registry.npmjs.org/combined-stream/-/combined-stream-0.0.7.tgz"; 502 | name = "combined-stream-0.0.7.tgz"; 503 | sha1 = "0137e657baa5a7541c57ac37ac5fc07d73b4dc1f"; 504 | }) 505 | ]; 506 | buildInputs = 507 | (self.nativeDeps."combined-stream" or []); 508 | deps = { 509 | "delayed-stream-0.0.5" = self.by-version."delayed-stream"."0.0.5"; 510 | }; 511 | peerDependencies = [ 512 | ]; 513 | passthru.names = [ "combined-stream" ]; 514 | }; 515 | by-spec."combined-stream"."~0.0.5" = 516 | self.by-version."combined-stream"."0.0.7"; 517 | by-spec."commander"."0.6.1" = 518 | self.by-version."commander"."0.6.1"; 519 | by-version."commander"."0.6.1" = lib.makeOverridable self.buildNodePackage { 520 | name = "commander-0.6.1"; 521 | bin = false; 522 | src = [ 523 | (fetchurl { 524 | url = "http://registry.npmjs.org/commander/-/commander-0.6.1.tgz"; 525 | name = "commander-0.6.1.tgz"; 526 | sha1 = "fa68a14f6a945d54dbbe50d8cdb3320e9e3b1a06"; 527 | }) 528 | ]; 529 | buildInputs = 530 | (self.nativeDeps."commander" or []); 531 | deps = { 532 | }; 533 | peerDependencies = [ 534 | ]; 535 | passthru.names = [ "commander" ]; 536 | }; 537 | by-spec."commander"."2.3.0" = 538 | self.by-version."commander"."2.3.0"; 539 | by-version."commander"."2.3.0" = lib.makeOverridable self.buildNodePackage { 540 | name = "commander-2.3.0"; 541 | bin = false; 542 | src = [ 543 | (fetchurl { 544 | url = "http://registry.npmjs.org/commander/-/commander-2.3.0.tgz"; 545 | name = "commander-2.3.0.tgz"; 546 | sha1 = "fd430e889832ec353b9acd1de217c11cb3eef873"; 547 | }) 548 | ]; 549 | buildInputs = 550 | (self.nativeDeps."commander" or []); 551 | deps = { 552 | }; 553 | peerDependencies = [ 554 | ]; 555 | passthru.names = [ "commander" ]; 556 | }; 557 | by-spec."commander"."^2.7.1" = 558 | self.by-version."commander"."2.8.0"; 559 | by-version."commander"."2.8.0" = lib.makeOverridable self.buildNodePackage { 560 | name = "commander-2.8.0"; 561 | bin = false; 562 | src = [ 563 | (fetchurl { 564 | url = "http://registry.npmjs.org/commander/-/commander-2.8.0.tgz"; 565 | name = "commander-2.8.0.tgz"; 566 | sha1 = "117c42659a72338e3364877df20852344095dc11"; 567 | }) 568 | ]; 569 | buildInputs = 570 | (self.nativeDeps."commander" or []); 571 | deps = { 572 | "graceful-readlink-1.0.1" = self.by-version."graceful-readlink"."1.0.1"; 573 | }; 574 | peerDependencies = [ 575 | ]; 576 | passthru.names = [ "commander" ]; 577 | }; 578 | by-spec."concat-map"."0.0.1" = 579 | self.by-version."concat-map"."0.0.1"; 580 | by-version."concat-map"."0.0.1" = lib.makeOverridable self.buildNodePackage { 581 | name = "concat-map-0.0.1"; 582 | bin = false; 583 | src = [ 584 | (fetchurl { 585 | url = "http://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz"; 586 | name = "concat-map-0.0.1.tgz"; 587 | sha1 = "d8a96bd77fd68df7793a73036a3ba0d5405d477b"; 588 | }) 589 | ]; 590 | buildInputs = 591 | (self.nativeDeps."concat-map" or []); 592 | deps = { 593 | }; 594 | peerDependencies = [ 595 | ]; 596 | passthru.names = [ "concat-map" ]; 597 | }; 598 | by-spec."core-util-is"."~1.0.0" = 599 | self.by-version."core-util-is"."1.0.1"; 600 | by-version."core-util-is"."1.0.1" = lib.makeOverridable self.buildNodePackage { 601 | name = "core-util-is-1.0.1"; 602 | bin = false; 603 | src = [ 604 | (fetchurl { 605 | url = "http://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz"; 606 | name = "core-util-is-1.0.1.tgz"; 607 | sha1 = "6b07085aef9a3ccac6ee53bf9d3df0c1521a5538"; 608 | }) 609 | ]; 610 | buildInputs = 611 | (self.nativeDeps."core-util-is" or []); 612 | deps = { 613 | }; 614 | peerDependencies = [ 615 | ]; 616 | passthru.names = [ "core-util-is" ]; 617 | }; 618 | by-spec."cryptiles"."2.x.x" = 619 | self.by-version."cryptiles"."2.0.4"; 620 | by-version."cryptiles"."2.0.4" = lib.makeOverridable self.buildNodePackage { 621 | name = "cryptiles-2.0.4"; 622 | bin = false; 623 | src = [ 624 | (fetchurl { 625 | url = "http://registry.npmjs.org/cryptiles/-/cryptiles-2.0.4.tgz"; 626 | name = "cryptiles-2.0.4.tgz"; 627 | sha1 = "09ea1775b9e1c7de7e60a99d42ab6f08ce1a1285"; 628 | }) 629 | ]; 630 | buildInputs = 631 | (self.nativeDeps."cryptiles" or []); 632 | deps = { 633 | "boom-2.7.0" = self.by-version."boom"."2.7.0"; 634 | }; 635 | peerDependencies = [ 636 | ]; 637 | passthru.names = [ "cryptiles" ]; 638 | }; 639 | by-spec."ctype"."0.5.3" = 640 | self.by-version."ctype"."0.5.3"; 641 | by-version."ctype"."0.5.3" = lib.makeOverridable self.buildNodePackage { 642 | name = "ctype-0.5.3"; 643 | bin = false; 644 | src = [ 645 | (fetchurl { 646 | url = "http://registry.npmjs.org/ctype/-/ctype-0.5.3.tgz"; 647 | name = "ctype-0.5.3.tgz"; 648 | sha1 = "82c18c2461f74114ef16c135224ad0b9144ca12f"; 649 | }) 650 | ]; 651 | buildInputs = 652 | (self.nativeDeps."ctype" or []); 653 | deps = { 654 | }; 655 | peerDependencies = [ 656 | ]; 657 | passthru.names = [ "ctype" ]; 658 | }; 659 | by-spec."debug"."2.0.0" = 660 | self.by-version."debug"."2.0.0"; 661 | by-version."debug"."2.0.0" = lib.makeOverridable self.buildNodePackage { 662 | name = "debug-2.0.0"; 663 | bin = false; 664 | src = [ 665 | (fetchurl { 666 | url = "http://registry.npmjs.org/debug/-/debug-2.0.0.tgz"; 667 | name = "debug-2.0.0.tgz"; 668 | sha1 = "89bd9df6732b51256bc6705342bba02ed12131ef"; 669 | }) 670 | ]; 671 | buildInputs = 672 | (self.nativeDeps."debug" or []); 673 | deps = { 674 | "ms-0.6.2" = self.by-version."ms"."0.6.2"; 675 | }; 676 | peerDependencies = [ 677 | ]; 678 | passthru.names = [ "debug" ]; 679 | }; 680 | by-spec."deep-eql"."0.1.3" = 681 | self.by-version."deep-eql"."0.1.3"; 682 | by-version."deep-eql"."0.1.3" = lib.makeOverridable self.buildNodePackage { 683 | name = "deep-eql-0.1.3"; 684 | bin = false; 685 | src = [ 686 | (fetchurl { 687 | url = "http://registry.npmjs.org/deep-eql/-/deep-eql-0.1.3.tgz"; 688 | name = "deep-eql-0.1.3.tgz"; 689 | sha1 = "ef558acab8de25206cd713906d74e56930eb69f2"; 690 | }) 691 | ]; 692 | buildInputs = 693 | (self.nativeDeps."deep-eql" or []); 694 | deps = { 695 | "type-detect-0.1.1" = self.by-version."type-detect"."0.1.1"; 696 | }; 697 | peerDependencies = [ 698 | ]; 699 | passthru.names = [ "deep-eql" ]; 700 | }; 701 | by-spec."delayed-stream"."0.0.5" = 702 | self.by-version."delayed-stream"."0.0.5"; 703 | by-version."delayed-stream"."0.0.5" = lib.makeOverridable self.buildNodePackage { 704 | name = "delayed-stream-0.0.5"; 705 | bin = false; 706 | src = [ 707 | (fetchurl { 708 | url = "http://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz"; 709 | name = "delayed-stream-0.0.5.tgz"; 710 | sha1 = "d4b1f43a93e8296dfe02694f4680bc37a313c73f"; 711 | }) 712 | ]; 713 | buildInputs = 714 | (self.nativeDeps."delayed-stream" or []); 715 | deps = { 716 | }; 717 | peerDependencies = [ 718 | ]; 719 | passthru.names = [ "delayed-stream" ]; 720 | }; 721 | by-spec."delegates"."^0.1.0" = 722 | self.by-version."delegates"."0.1.0"; 723 | by-version."delegates"."0.1.0" = lib.makeOverridable self.buildNodePackage { 724 | name = "delegates-0.1.0"; 725 | bin = false; 726 | src = [ 727 | (fetchurl { 728 | url = "http://registry.npmjs.org/delegates/-/delegates-0.1.0.tgz"; 729 | name = "delegates-0.1.0.tgz"; 730 | sha1 = "b4b57be11a1653517a04b27f0949bdc327dfe390"; 731 | }) 732 | ]; 733 | buildInputs = 734 | (self.nativeDeps."delegates" or []); 735 | deps = { 736 | }; 737 | peerDependencies = [ 738 | ]; 739 | passthru.names = [ "delegates" ]; 740 | }; 741 | by-spec."diff"."1.0.8" = 742 | self.by-version."diff"."1.0.8"; 743 | by-version."diff"."1.0.8" = lib.makeOverridable self.buildNodePackage { 744 | name = "diff-1.0.8"; 745 | bin = false; 746 | src = [ 747 | (fetchurl { 748 | url = "http://registry.npmjs.org/diff/-/diff-1.0.8.tgz"; 749 | name = "diff-1.0.8.tgz"; 750 | sha1 = "343276308ec991b7bc82267ed55bc1411f971666"; 751 | }) 752 | ]; 753 | buildInputs = 754 | (self.nativeDeps."diff" or []); 755 | deps = { 756 | }; 757 | peerDependencies = [ 758 | ]; 759 | passthru.names = [ "diff" ]; 760 | }; 761 | by-spec."escape-string-regexp"."1.0.2" = 762 | self.by-version."escape-string-regexp"."1.0.2"; 763 | by-version."escape-string-regexp"."1.0.2" = lib.makeOverridable self.buildNodePackage { 764 | name = "escape-string-regexp-1.0.2"; 765 | bin = false; 766 | src = [ 767 | (fetchurl { 768 | url = "http://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.2.tgz"; 769 | name = "escape-string-regexp-1.0.2.tgz"; 770 | sha1 = "4dbc2fe674e71949caf3fb2695ce7f2dc1d9a8d1"; 771 | }) 772 | ]; 773 | buildInputs = 774 | (self.nativeDeps."escape-string-regexp" or []); 775 | deps = { 776 | }; 777 | peerDependencies = [ 778 | ]; 779 | passthru.names = [ "escape-string-regexp" ]; 780 | }; 781 | by-spec."escape-string-regexp"."^1.0.2" = 782 | self.by-version."escape-string-regexp"."1.0.3"; 783 | by-version."escape-string-regexp"."1.0.3" = lib.makeOverridable self.buildNodePackage { 784 | name = "escape-string-regexp-1.0.3"; 785 | bin = false; 786 | src = [ 787 | (fetchurl { 788 | url = "http://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.3.tgz"; 789 | name = "escape-string-regexp-1.0.3.tgz"; 790 | sha1 = "9e2d8b25bc2555c3336723750e03f099c2735bb5"; 791 | }) 792 | ]; 793 | buildInputs = 794 | (self.nativeDeps."escape-string-regexp" or []); 795 | deps = { 796 | }; 797 | peerDependencies = [ 798 | ]; 799 | passthru.names = [ "escape-string-regexp" ]; 800 | }; 801 | by-spec."forever-agent"."~0.6.0" = 802 | self.by-version."forever-agent"."0.6.1"; 803 | by-version."forever-agent"."0.6.1" = lib.makeOverridable self.buildNodePackage { 804 | name = "forever-agent-0.6.1"; 805 | bin = false; 806 | src = [ 807 | (fetchurl { 808 | url = "http://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz"; 809 | name = "forever-agent-0.6.1.tgz"; 810 | sha1 = "fbc71f0c41adeb37f96c577ad1ed42d8fdacca91"; 811 | }) 812 | ]; 813 | buildInputs = 814 | (self.nativeDeps."forever-agent" or []); 815 | deps = { 816 | }; 817 | peerDependencies = [ 818 | ]; 819 | passthru.names = [ "forever-agent" ]; 820 | }; 821 | by-spec."form-data"."~0.2.0" = 822 | self.by-version."form-data"."0.2.0"; 823 | by-version."form-data"."0.2.0" = lib.makeOverridable self.buildNodePackage { 824 | name = "form-data-0.2.0"; 825 | bin = false; 826 | src = [ 827 | (fetchurl { 828 | url = "http://registry.npmjs.org/form-data/-/form-data-0.2.0.tgz"; 829 | name = "form-data-0.2.0.tgz"; 830 | sha1 = "26f8bc26da6440e299cbdcfb69035c4f77a6e466"; 831 | }) 832 | ]; 833 | buildInputs = 834 | (self.nativeDeps."form-data" or []); 835 | deps = { 836 | "async-0.9.0" = self.by-version."async"."0.9.0"; 837 | "combined-stream-0.0.7" = self.by-version."combined-stream"."0.0.7"; 838 | "mime-types-2.0.10" = self.by-version."mime-types"."2.0.10"; 839 | }; 840 | peerDependencies = [ 841 | ]; 842 | passthru.names = [ "form-data" ]; 843 | }; 844 | by-spec."fstream"."^1.0.0" = 845 | self.by-version."fstream"."1.0.4"; 846 | by-version."fstream"."1.0.4" = lib.makeOverridable self.buildNodePackage { 847 | name = "fstream-1.0.4"; 848 | bin = false; 849 | src = [ 850 | (fetchurl { 851 | url = "http://registry.npmjs.org/fstream/-/fstream-1.0.4.tgz"; 852 | name = "fstream-1.0.4.tgz"; 853 | sha1 = "6c52298473fd6351fd22fc4bf9254fcfebe80f2b"; 854 | }) 855 | ]; 856 | buildInputs = 857 | (self.nativeDeps."fstream" or []); 858 | deps = { 859 | "graceful-fs-3.0.6" = self.by-version."graceful-fs"."3.0.6"; 860 | "inherits-2.0.1" = self.by-version."inherits"."2.0.1"; 861 | "mkdirp-0.5.0" = self.by-version."mkdirp"."0.5.0"; 862 | "rimraf-2.3.2" = self.by-version."rimraf"."2.3.2"; 863 | }; 864 | peerDependencies = [ 865 | ]; 866 | passthru.names = [ "fstream" ]; 867 | }; 868 | by-spec."fstream"."^1.0.2" = 869 | self.by-version."fstream"."1.0.4"; 870 | by-spec."gauge"."~1.2.0" = 871 | self.by-version."gauge"."1.2.0"; 872 | by-version."gauge"."1.2.0" = lib.makeOverridable self.buildNodePackage { 873 | name = "gauge-1.2.0"; 874 | bin = false; 875 | src = [ 876 | (fetchurl { 877 | url = "http://registry.npmjs.org/gauge/-/gauge-1.2.0.tgz"; 878 | name = "gauge-1.2.0.tgz"; 879 | sha1 = "3094ab1285633f799814388fc8f2de67b4c012c5"; 880 | }) 881 | ]; 882 | buildInputs = 883 | (self.nativeDeps."gauge" or []); 884 | deps = { 885 | "ansi-0.3.0" = self.by-version."ansi"."0.3.0"; 886 | "has-unicode-1.0.0" = self.by-version."has-unicode"."1.0.0"; 887 | "lodash.pad-3.1.0" = self.by-version."lodash.pad"."3.1.0"; 888 | "lodash.padleft-3.1.0" = self.by-version."lodash.padleft"."3.1.0"; 889 | "lodash.padright-3.1.0" = self.by-version."lodash.padright"."3.1.0"; 890 | }; 891 | peerDependencies = [ 892 | ]; 893 | passthru.names = [ "gauge" ]; 894 | }; 895 | by-spec."generate-function"."^2.0.0" = 896 | self.by-version."generate-function"."2.0.0"; 897 | by-version."generate-function"."2.0.0" = lib.makeOverridable self.buildNodePackage { 898 | name = "generate-function-2.0.0"; 899 | bin = false; 900 | src = [ 901 | (fetchurl { 902 | url = "http://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz"; 903 | name = "generate-function-2.0.0.tgz"; 904 | sha1 = "6858fe7c0969b7d4e9093337647ac79f60dfbe74"; 905 | }) 906 | ]; 907 | buildInputs = 908 | (self.nativeDeps."generate-function" or []); 909 | deps = { 910 | }; 911 | peerDependencies = [ 912 | ]; 913 | passthru.names = [ "generate-function" ]; 914 | }; 915 | by-spec."generate-object-property"."^1.1.0" = 916 | self.by-version."generate-object-property"."1.1.1"; 917 | by-version."generate-object-property"."1.1.1" = lib.makeOverridable self.buildNodePackage { 918 | name = "generate-object-property-1.1.1"; 919 | bin = false; 920 | src = [ 921 | (fetchurl { 922 | url = "http://registry.npmjs.org/generate-object-property/-/generate-object-property-1.1.1.tgz"; 923 | name = "generate-object-property-1.1.1.tgz"; 924 | sha1 = "8fda6b4cb69b34a189a6cebee7c4c268af47cc93"; 925 | }) 926 | ]; 927 | buildInputs = 928 | (self.nativeDeps."generate-object-property" or []); 929 | deps = { 930 | "is-property-1.0.2" = self.by-version."is-property"."1.0.2"; 931 | }; 932 | peerDependencies = [ 933 | ]; 934 | passthru.names = [ "generate-object-property" ]; 935 | }; 936 | by-spec."get-stdin"."^4.0.1" = 937 | self.by-version."get-stdin"."4.0.1"; 938 | by-version."get-stdin"."4.0.1" = lib.makeOverridable self.buildNodePackage { 939 | name = "get-stdin-4.0.1"; 940 | bin = false; 941 | src = [ 942 | (fetchurl { 943 | url = "http://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz"; 944 | name = "get-stdin-4.0.1.tgz"; 945 | sha1 = "b968c6b0a04384324902e8bf1a5df32579a450fe"; 946 | }) 947 | ]; 948 | buildInputs = 949 | (self.nativeDeps."get-stdin" or []); 950 | deps = { 951 | }; 952 | peerDependencies = [ 953 | ]; 954 | passthru.names = [ "get-stdin" ]; 955 | }; 956 | by-spec."glob"."3 || 4" = 957 | self.by-version."glob"."4.5.3"; 958 | by-version."glob"."4.5.3" = lib.makeOverridable self.buildNodePackage { 959 | name = "glob-4.5.3"; 960 | bin = false; 961 | src = [ 962 | (fetchurl { 963 | url = "http://registry.npmjs.org/glob/-/glob-4.5.3.tgz"; 964 | name = "glob-4.5.3.tgz"; 965 | sha1 = "c6cb73d3226c1efef04de3c56d012f03377ee15f"; 966 | }) 967 | ]; 968 | buildInputs = 969 | (self.nativeDeps."glob" or []); 970 | deps = { 971 | "inflight-1.0.4" = self.by-version."inflight"."1.0.4"; 972 | "inherits-2.0.1" = self.by-version."inherits"."2.0.1"; 973 | "minimatch-2.0.4" = self.by-version."minimatch"."2.0.4"; 974 | "once-1.3.1" = self.by-version."once"."1.3.1"; 975 | }; 976 | peerDependencies = [ 977 | ]; 978 | passthru.names = [ "glob" ]; 979 | }; 980 | by-spec."glob"."3.2.3" = 981 | self.by-version."glob"."3.2.3"; 982 | by-version."glob"."3.2.3" = lib.makeOverridable self.buildNodePackage { 983 | name = "glob-3.2.3"; 984 | bin = false; 985 | src = [ 986 | (fetchurl { 987 | url = "http://registry.npmjs.org/glob/-/glob-3.2.3.tgz"; 988 | name = "glob-3.2.3.tgz"; 989 | sha1 = "e313eeb249c7affaa5c475286b0e115b59839467"; 990 | }) 991 | ]; 992 | buildInputs = 993 | (self.nativeDeps."glob" or []); 994 | deps = { 995 | "minimatch-0.2.14" = self.by-version."minimatch"."0.2.14"; 996 | "graceful-fs-2.0.3" = self.by-version."graceful-fs"."2.0.3"; 997 | "inherits-2.0.1" = self.by-version."inherits"."2.0.1"; 998 | }; 999 | peerDependencies = [ 1000 | ]; 1001 | passthru.names = [ "glob" ]; 1002 | }; 1003 | by-spec."glob"."^4.0.0" = 1004 | self.by-version."glob"."4.5.3"; 1005 | by-spec."glob"."^4.4.2" = 1006 | self.by-version."glob"."4.5.3"; 1007 | by-spec."graceful-fs"."3" = 1008 | self.by-version."graceful-fs"."3.0.6"; 1009 | by-version."graceful-fs"."3.0.6" = lib.makeOverridable self.buildNodePackage { 1010 | name = "graceful-fs-3.0.6"; 1011 | bin = false; 1012 | src = [ 1013 | (fetchurl { 1014 | url = "http://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.6.tgz"; 1015 | name = "graceful-fs-3.0.6.tgz"; 1016 | sha1 = "dce3a18351cb94cdc82e688b2e3dd2842d1b09bb"; 1017 | }) 1018 | ]; 1019 | buildInputs = 1020 | (self.nativeDeps."graceful-fs" or []); 1021 | deps = { 1022 | }; 1023 | peerDependencies = [ 1024 | ]; 1025 | passthru.names = [ "graceful-fs" ]; 1026 | }; 1027 | by-spec."graceful-fs"."~2.0.0" = 1028 | self.by-version."graceful-fs"."2.0.3"; 1029 | by-version."graceful-fs"."2.0.3" = lib.makeOverridable self.buildNodePackage { 1030 | name = "graceful-fs-2.0.3"; 1031 | bin = false; 1032 | src = [ 1033 | (fetchurl { 1034 | url = "http://registry.npmjs.org/graceful-fs/-/graceful-fs-2.0.3.tgz"; 1035 | name = "graceful-fs-2.0.3.tgz"; 1036 | sha1 = "7cd2cdb228a4a3f36e95efa6cc142de7d1a136d0"; 1037 | }) 1038 | ]; 1039 | buildInputs = 1040 | (self.nativeDeps."graceful-fs" or []); 1041 | deps = { 1042 | }; 1043 | peerDependencies = [ 1044 | ]; 1045 | passthru.names = [ "graceful-fs" ]; 1046 | }; 1047 | by-spec."graceful-readlink".">= 1.0.0" = 1048 | self.by-version."graceful-readlink"."1.0.1"; 1049 | by-version."graceful-readlink"."1.0.1" = lib.makeOverridable self.buildNodePackage { 1050 | name = "graceful-readlink-1.0.1"; 1051 | bin = false; 1052 | src = [ 1053 | (fetchurl { 1054 | url = "http://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz"; 1055 | name = "graceful-readlink-1.0.1.tgz"; 1056 | sha1 = "4cafad76bc62f02fa039b2f94e9a3dd3a391a725"; 1057 | }) 1058 | ]; 1059 | buildInputs = 1060 | (self.nativeDeps."graceful-readlink" or []); 1061 | deps = { 1062 | }; 1063 | peerDependencies = [ 1064 | ]; 1065 | passthru.names = [ "graceful-readlink" ]; 1066 | }; 1067 | by-spec."growl"."1.8.1" = 1068 | self.by-version."growl"."1.8.1"; 1069 | by-version."growl"."1.8.1" = lib.makeOverridable self.buildNodePackage { 1070 | name = "growl-1.8.1"; 1071 | bin = false; 1072 | src = [ 1073 | (fetchurl { 1074 | url = "http://registry.npmjs.org/growl/-/growl-1.8.1.tgz"; 1075 | name = "growl-1.8.1.tgz"; 1076 | sha1 = "4b2dec8d907e93db336624dcec0183502f8c9428"; 1077 | }) 1078 | ]; 1079 | buildInputs = 1080 | (self.nativeDeps."growl" or []); 1081 | deps = { 1082 | }; 1083 | peerDependencies = [ 1084 | ]; 1085 | passthru.names = [ "growl" ]; 1086 | }; 1087 | by-spec."har-validator"."^1.4.0" = 1088 | self.by-version."har-validator"."1.6.1"; 1089 | by-version."har-validator"."1.6.1" = lib.makeOverridable self.buildNodePackage { 1090 | name = "har-validator-1.6.1"; 1091 | bin = true; 1092 | src = [ 1093 | (fetchurl { 1094 | url = "http://registry.npmjs.org/har-validator/-/har-validator-1.6.1.tgz"; 1095 | name = "har-validator-1.6.1.tgz"; 1096 | sha1 = "baef452cde645eff7d26562e8e749d7fd000b7fd"; 1097 | }) 1098 | ]; 1099 | buildInputs = 1100 | (self.nativeDeps."har-validator" or []); 1101 | deps = { 1102 | "bluebird-2.9.24" = self.by-version."bluebird"."2.9.24"; 1103 | "chalk-1.0.0" = self.by-version."chalk"."1.0.0"; 1104 | "commander-2.8.0" = self.by-version."commander"."2.8.0"; 1105 | "is-my-json-valid-2.10.1" = self.by-version."is-my-json-valid"."2.10.1"; 1106 | }; 1107 | peerDependencies = [ 1108 | ]; 1109 | passthru.names = [ "har-validator" ]; 1110 | }; 1111 | by-spec."has-ansi"."^1.0.3" = 1112 | self.by-version."has-ansi"."1.0.3"; 1113 | by-version."has-ansi"."1.0.3" = lib.makeOverridable self.buildNodePackage { 1114 | name = "has-ansi-1.0.3"; 1115 | bin = true; 1116 | src = [ 1117 | (fetchurl { 1118 | url = "http://registry.npmjs.org/has-ansi/-/has-ansi-1.0.3.tgz"; 1119 | name = "has-ansi-1.0.3.tgz"; 1120 | sha1 = "c0b5b1615d9e382b0ff67169d967b425e48ca538"; 1121 | }) 1122 | ]; 1123 | buildInputs = 1124 | (self.nativeDeps."has-ansi" or []); 1125 | deps = { 1126 | "ansi-regex-1.1.1" = self.by-version."ansi-regex"."1.1.1"; 1127 | "get-stdin-4.0.1" = self.by-version."get-stdin"."4.0.1"; 1128 | }; 1129 | peerDependencies = [ 1130 | ]; 1131 | passthru.names = [ "has-ansi" ]; 1132 | }; 1133 | by-spec."has-unicode"."^1.0.0" = 1134 | self.by-version."has-unicode"."1.0.0"; 1135 | by-version."has-unicode"."1.0.0" = lib.makeOverridable self.buildNodePackage { 1136 | name = "has-unicode-1.0.0"; 1137 | bin = false; 1138 | src = [ 1139 | (fetchurl { 1140 | url = "http://registry.npmjs.org/has-unicode/-/has-unicode-1.0.0.tgz"; 1141 | name = "has-unicode-1.0.0.tgz"; 1142 | sha1 = "bac5c44e064c2ffc3b8fcbd8c71afe08f9afc8cc"; 1143 | }) 1144 | ]; 1145 | buildInputs = 1146 | (self.nativeDeps."has-unicode" or []); 1147 | deps = { 1148 | }; 1149 | peerDependencies = [ 1150 | ]; 1151 | passthru.names = [ "has-unicode" ]; 1152 | }; 1153 | by-spec."hawk"."~2.3.0" = 1154 | self.by-version."hawk"."2.3.1"; 1155 | by-version."hawk"."2.3.1" = lib.makeOverridable self.buildNodePackage { 1156 | name = "hawk-2.3.1"; 1157 | bin = false; 1158 | src = [ 1159 | (fetchurl { 1160 | url = "http://registry.npmjs.org/hawk/-/hawk-2.3.1.tgz"; 1161 | name = "hawk-2.3.1.tgz"; 1162 | sha1 = "1e731ce39447fa1d0f6d707f7bceebec0fd1ec1f"; 1163 | }) 1164 | ]; 1165 | buildInputs = 1166 | (self.nativeDeps."hawk" or []); 1167 | deps = { 1168 | "hoek-2.12.0" = self.by-version."hoek"."2.12.0"; 1169 | "boom-2.7.0" = self.by-version."boom"."2.7.0"; 1170 | "cryptiles-2.0.4" = self.by-version."cryptiles"."2.0.4"; 1171 | "sntp-1.0.9" = self.by-version."sntp"."1.0.9"; 1172 | }; 1173 | peerDependencies = [ 1174 | ]; 1175 | passthru.names = [ "hawk" ]; 1176 | }; 1177 | by-spec."hoek"."2.x.x" = 1178 | self.by-version."hoek"."2.12.0"; 1179 | by-version."hoek"."2.12.0" = lib.makeOverridable self.buildNodePackage { 1180 | name = "hoek-2.12.0"; 1181 | bin = false; 1182 | src = [ 1183 | (fetchurl { 1184 | url = "http://registry.npmjs.org/hoek/-/hoek-2.12.0.tgz"; 1185 | name = "hoek-2.12.0.tgz"; 1186 | sha1 = "5d1196e0bf20c5cec957e8927101164effdaf1c9"; 1187 | }) 1188 | ]; 1189 | buildInputs = 1190 | (self.nativeDeps."hoek" or []); 1191 | deps = { 1192 | }; 1193 | peerDependencies = [ 1194 | ]; 1195 | passthru.names = [ "hoek" ]; 1196 | }; 1197 | by-spec."http-signature"."~0.10.0" = 1198 | self.by-version."http-signature"."0.10.1"; 1199 | by-version."http-signature"."0.10.1" = lib.makeOverridable self.buildNodePackage { 1200 | name = "http-signature-0.10.1"; 1201 | bin = false; 1202 | src = [ 1203 | (fetchurl { 1204 | url = "http://registry.npmjs.org/http-signature/-/http-signature-0.10.1.tgz"; 1205 | name = "http-signature-0.10.1.tgz"; 1206 | sha1 = "4fbdac132559aa8323121e540779c0a012b27e66"; 1207 | }) 1208 | ]; 1209 | buildInputs = 1210 | (self.nativeDeps."http-signature" or []); 1211 | deps = { 1212 | "assert-plus-0.1.5" = self.by-version."assert-plus"."0.1.5"; 1213 | "asn1-0.1.11" = self.by-version."asn1"."0.1.11"; 1214 | "ctype-0.5.3" = self.by-version."ctype"."0.5.3"; 1215 | }; 1216 | peerDependencies = [ 1217 | ]; 1218 | passthru.names = [ "http-signature" ]; 1219 | }; 1220 | by-spec."ignore"."^2.2.15" = 1221 | self.by-version."ignore"."2.2.15"; 1222 | by-version."ignore"."2.2.15" = lib.makeOverridable self.buildNodePackage { 1223 | name = "ignore-2.2.15"; 1224 | bin = false; 1225 | src = [ 1226 | (fetchurl { 1227 | url = "http://registry.npmjs.org/ignore/-/ignore-2.2.15.tgz"; 1228 | name = "ignore-2.2.15.tgz"; 1229 | sha1 = "6bd552185e0d1cd393b416603ee686879ec3bc3b"; 1230 | }) 1231 | ]; 1232 | buildInputs = 1233 | (self.nativeDeps."ignore" or []); 1234 | deps = { 1235 | }; 1236 | peerDependencies = [ 1237 | ]; 1238 | passthru.names = [ "ignore" ]; 1239 | }; 1240 | by-spec."inflight"."^1.0.4" = 1241 | self.by-version."inflight"."1.0.4"; 1242 | by-version."inflight"."1.0.4" = lib.makeOverridable self.buildNodePackage { 1243 | name = "inflight-1.0.4"; 1244 | bin = false; 1245 | src = [ 1246 | (fetchurl { 1247 | url = "http://registry.npmjs.org/inflight/-/inflight-1.0.4.tgz"; 1248 | name = "inflight-1.0.4.tgz"; 1249 | sha1 = "6cbb4521ebd51ce0ec0a936bfd7657ef7e9b172a"; 1250 | }) 1251 | ]; 1252 | buildInputs = 1253 | (self.nativeDeps."inflight" or []); 1254 | deps = { 1255 | "once-1.3.1" = self.by-version."once"."1.3.1"; 1256 | "wrappy-1.0.1" = self.by-version."wrappy"."1.0.1"; 1257 | }; 1258 | peerDependencies = [ 1259 | ]; 1260 | passthru.names = [ "inflight" ]; 1261 | }; 1262 | by-spec."inherits"."2" = 1263 | self.by-version."inherits"."2.0.1"; 1264 | by-version."inherits"."2.0.1" = lib.makeOverridable self.buildNodePackage { 1265 | name = "inherits-2.0.1"; 1266 | bin = false; 1267 | src = [ 1268 | (fetchurl { 1269 | url = "http://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"; 1270 | name = "inherits-2.0.1.tgz"; 1271 | sha1 = "b17d08d326b4423e568eff719f91b0b1cbdf69f1"; 1272 | }) 1273 | ]; 1274 | buildInputs = 1275 | (self.nativeDeps."inherits" or []); 1276 | deps = { 1277 | }; 1278 | peerDependencies = [ 1279 | ]; 1280 | passthru.names = [ "inherits" ]; 1281 | }; 1282 | by-spec."inherits"."~2.0.0" = 1283 | self.by-version."inherits"."2.0.1"; 1284 | by-spec."inherits"."~2.0.1" = 1285 | self.by-version."inherits"."2.0.1"; 1286 | by-spec."is-my-json-valid"."^2.10.0" = 1287 | self.by-version."is-my-json-valid"."2.10.1"; 1288 | by-version."is-my-json-valid"."2.10.1" = lib.makeOverridable self.buildNodePackage { 1289 | name = "is-my-json-valid-2.10.1"; 1290 | bin = false; 1291 | src = [ 1292 | (fetchurl { 1293 | url = "http://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.10.1.tgz"; 1294 | name = "is-my-json-valid-2.10.1.tgz"; 1295 | sha1 = "bf20ca7e71116302f8660ac812659f71e22ea2d0"; 1296 | }) 1297 | ]; 1298 | buildInputs = 1299 | (self.nativeDeps."is-my-json-valid" or []); 1300 | deps = { 1301 | "generate-function-2.0.0" = self.by-version."generate-function"."2.0.0"; 1302 | "generate-object-property-1.1.1" = self.by-version."generate-object-property"."1.1.1"; 1303 | "jsonpointer-1.1.0" = self.by-version."jsonpointer"."1.1.0"; 1304 | "xtend-4.0.0" = self.by-version."xtend"."4.0.0"; 1305 | }; 1306 | peerDependencies = [ 1307 | ]; 1308 | passthru.names = [ "is-my-json-valid" ]; 1309 | }; 1310 | by-spec."is-property"."^1.0.0" = 1311 | self.by-version."is-property"."1.0.2"; 1312 | by-version."is-property"."1.0.2" = lib.makeOverridable self.buildNodePackage { 1313 | name = "is-property-1.0.2"; 1314 | bin = false; 1315 | src = [ 1316 | (fetchurl { 1317 | url = "http://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz"; 1318 | name = "is-property-1.0.2.tgz"; 1319 | sha1 = "57fe1c4e48474edd65b09911f26b1cd4095dda84"; 1320 | }) 1321 | ]; 1322 | buildInputs = 1323 | (self.nativeDeps."is-property" or []); 1324 | deps = { 1325 | }; 1326 | peerDependencies = [ 1327 | ]; 1328 | passthru.names = [ "is-property" ]; 1329 | }; 1330 | by-spec."isarray"."0.0.1" = 1331 | self.by-version."isarray"."0.0.1"; 1332 | by-version."isarray"."0.0.1" = lib.makeOverridable self.buildNodePackage { 1333 | name = "isarray-0.0.1"; 1334 | bin = false; 1335 | src = [ 1336 | (fetchurl { 1337 | url = "http://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz"; 1338 | name = "isarray-0.0.1.tgz"; 1339 | sha1 = "8a18acfca9a8f4177e09abfc6038939b05d1eedf"; 1340 | }) 1341 | ]; 1342 | buildInputs = 1343 | (self.nativeDeps."isarray" or []); 1344 | deps = { 1345 | }; 1346 | peerDependencies = [ 1347 | ]; 1348 | passthru.names = [ "isarray" ]; 1349 | }; 1350 | by-spec."isstream"."~0.1.1" = 1351 | self.by-version."isstream"."0.1.2"; 1352 | by-version."isstream"."0.1.2" = lib.makeOverridable self.buildNodePackage { 1353 | name = "isstream-0.1.2"; 1354 | bin = false; 1355 | src = [ 1356 | (fetchurl { 1357 | url = "http://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz"; 1358 | name = "isstream-0.1.2.tgz"; 1359 | sha1 = "47e63f7af55afa6f92e1500e690eb8b8529c099a"; 1360 | }) 1361 | ]; 1362 | buildInputs = 1363 | (self.nativeDeps."isstream" or []); 1364 | deps = { 1365 | }; 1366 | peerDependencies = [ 1367 | ]; 1368 | passthru.names = [ "isstream" ]; 1369 | }; 1370 | by-spec."jade"."0.26.3" = 1371 | self.by-version."jade"."0.26.3"; 1372 | by-version."jade"."0.26.3" = lib.makeOverridable self.buildNodePackage { 1373 | name = "jade-0.26.3"; 1374 | bin = true; 1375 | src = [ 1376 | (fetchurl { 1377 | url = "http://registry.npmjs.org/jade/-/jade-0.26.3.tgz"; 1378 | name = "jade-0.26.3.tgz"; 1379 | sha1 = "8f10d7977d8d79f2f6ff862a81b0513ccb25686c"; 1380 | }) 1381 | ]; 1382 | buildInputs = 1383 | (self.nativeDeps."jade" or []); 1384 | deps = { 1385 | "commander-0.6.1" = self.by-version."commander"."0.6.1"; 1386 | "mkdirp-0.3.0" = self.by-version."mkdirp"."0.3.0"; 1387 | }; 1388 | peerDependencies = [ 1389 | ]; 1390 | passthru.names = [ "jade" ]; 1391 | }; 1392 | by-spec."json-stringify-safe"."~5.0.0" = 1393 | self.by-version."json-stringify-safe"."5.0.0"; 1394 | by-version."json-stringify-safe"."5.0.0" = lib.makeOverridable self.buildNodePackage { 1395 | name = "json-stringify-safe-5.0.0"; 1396 | bin = false; 1397 | src = [ 1398 | (fetchurl { 1399 | url = "http://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.0.tgz"; 1400 | name = "json-stringify-safe-5.0.0.tgz"; 1401 | sha1 = "4c1f228b5050837eba9d21f50c2e6e320624566e"; 1402 | }) 1403 | ]; 1404 | buildInputs = 1405 | (self.nativeDeps."json-stringify-safe" or []); 1406 | deps = { 1407 | }; 1408 | peerDependencies = [ 1409 | ]; 1410 | passthru.names = [ "json-stringify-safe" ]; 1411 | }; 1412 | by-spec."jsonpointer"."^1.1.0" = 1413 | self.by-version."jsonpointer"."1.1.0"; 1414 | by-version."jsonpointer"."1.1.0" = lib.makeOverridable self.buildNodePackage { 1415 | name = "jsonpointer-1.1.0"; 1416 | bin = false; 1417 | src = [ 1418 | (fetchurl { 1419 | url = "http://registry.npmjs.org/jsonpointer/-/jsonpointer-1.1.0.tgz"; 1420 | name = "jsonpointer-1.1.0.tgz"; 1421 | sha1 = "c3c72efaed3b97154163dc01dd349e1cfe0f80fc"; 1422 | }) 1423 | ]; 1424 | buildInputs = 1425 | (self.nativeDeps."jsonpointer" or []); 1426 | deps = { 1427 | }; 1428 | peerDependencies = [ 1429 | ]; 1430 | passthru.names = [ "jsonpointer" ]; 1431 | }; 1432 | by-spec."lodash._basetostring"."^3.0.0" = 1433 | self.by-version."lodash._basetostring"."3.0.0"; 1434 | by-version."lodash._basetostring"."3.0.0" = lib.makeOverridable self.buildNodePackage { 1435 | name = "lodash._basetostring-3.0.0"; 1436 | bin = false; 1437 | src = [ 1438 | (fetchurl { 1439 | url = "http://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-3.0.0.tgz"; 1440 | name = "lodash._basetostring-3.0.0.tgz"; 1441 | sha1 = "75a9a4aaaa2b2a8761111ff5431e7d83c1daf0e2"; 1442 | }) 1443 | ]; 1444 | buildInputs = 1445 | (self.nativeDeps."lodash._basetostring" or []); 1446 | deps = { 1447 | }; 1448 | peerDependencies = [ 1449 | ]; 1450 | passthru.names = [ "lodash._basetostring" ]; 1451 | }; 1452 | by-spec."lodash._createpadding"."^3.0.0" = 1453 | self.by-version."lodash._createpadding"."3.6.0"; 1454 | by-version."lodash._createpadding"."3.6.0" = lib.makeOverridable self.buildNodePackage { 1455 | name = "lodash._createpadding-3.6.0"; 1456 | bin = false; 1457 | src = [ 1458 | (fetchurl { 1459 | url = "http://registry.npmjs.org/lodash._createpadding/-/lodash._createpadding-3.6.0.tgz"; 1460 | name = "lodash._createpadding-3.6.0.tgz"; 1461 | sha1 = "c466850dd1a05e6bfec54fd0cf0db28b68332d5e"; 1462 | }) 1463 | ]; 1464 | buildInputs = 1465 | (self.nativeDeps."lodash._createpadding" or []); 1466 | deps = { 1467 | "lodash.repeat-3.0.0" = self.by-version."lodash.repeat"."3.0.0"; 1468 | }; 1469 | peerDependencies = [ 1470 | ]; 1471 | passthru.names = [ "lodash._createpadding" ]; 1472 | }; 1473 | by-spec."lodash.pad"."^3.0.0" = 1474 | self.by-version."lodash.pad"."3.1.0"; 1475 | by-version."lodash.pad"."3.1.0" = lib.makeOverridable self.buildNodePackage { 1476 | name = "lodash.pad-3.1.0"; 1477 | bin = false; 1478 | src = [ 1479 | (fetchurl { 1480 | url = "http://registry.npmjs.org/lodash.pad/-/lodash.pad-3.1.0.tgz"; 1481 | name = "lodash.pad-3.1.0.tgz"; 1482 | sha1 = "9f18b1f3749a95e197b5ff2ae752ea9851ada965"; 1483 | }) 1484 | ]; 1485 | buildInputs = 1486 | (self.nativeDeps."lodash.pad" or []); 1487 | deps = { 1488 | "lodash._basetostring-3.0.0" = self.by-version."lodash._basetostring"."3.0.0"; 1489 | "lodash._createpadding-3.6.0" = self.by-version."lodash._createpadding"."3.6.0"; 1490 | }; 1491 | peerDependencies = [ 1492 | ]; 1493 | passthru.names = [ "lodash.pad" ]; 1494 | }; 1495 | by-spec."lodash.padleft"."^3.0.0" = 1496 | self.by-version."lodash.padleft"."3.1.0"; 1497 | by-version."lodash.padleft"."3.1.0" = lib.makeOverridable self.buildNodePackage { 1498 | name = "lodash.padleft-3.1.0"; 1499 | bin = false; 1500 | src = [ 1501 | (fetchurl { 1502 | url = "http://registry.npmjs.org/lodash.padleft/-/lodash.padleft-3.1.0.tgz"; 1503 | name = "lodash.padleft-3.1.0.tgz"; 1504 | sha1 = "ac94eeeb3ec4df6394b893c6f4f7faa5cb96a5c1"; 1505 | }) 1506 | ]; 1507 | buildInputs = 1508 | (self.nativeDeps."lodash.padleft" or []); 1509 | deps = { 1510 | "lodash._basetostring-3.0.0" = self.by-version."lodash._basetostring"."3.0.0"; 1511 | "lodash._createpadding-3.6.0" = self.by-version."lodash._createpadding"."3.6.0"; 1512 | }; 1513 | peerDependencies = [ 1514 | ]; 1515 | passthru.names = [ "lodash.padleft" ]; 1516 | }; 1517 | by-spec."lodash.padright"."^3.0.0" = 1518 | self.by-version."lodash.padright"."3.1.0"; 1519 | by-version."lodash.padright"."3.1.0" = lib.makeOverridable self.buildNodePackage { 1520 | name = "lodash.padright-3.1.0"; 1521 | bin = false; 1522 | src = [ 1523 | (fetchurl { 1524 | url = "http://registry.npmjs.org/lodash.padright/-/lodash.padright-3.1.0.tgz"; 1525 | name = "lodash.padright-3.1.0.tgz"; 1526 | sha1 = "155aa4ed10f4103829031a14516dcb5f3f6c777f"; 1527 | }) 1528 | ]; 1529 | buildInputs = 1530 | (self.nativeDeps."lodash.padright" or []); 1531 | deps = { 1532 | "lodash._basetostring-3.0.0" = self.by-version."lodash._basetostring"."3.0.0"; 1533 | "lodash._createpadding-3.6.0" = self.by-version."lodash._createpadding"."3.6.0"; 1534 | }; 1535 | peerDependencies = [ 1536 | ]; 1537 | passthru.names = [ "lodash.padright" ]; 1538 | }; 1539 | by-spec."lodash.repeat"."^3.0.0" = 1540 | self.by-version."lodash.repeat"."3.0.0"; 1541 | by-version."lodash.repeat"."3.0.0" = lib.makeOverridable self.buildNodePackage { 1542 | name = "lodash.repeat-3.0.0"; 1543 | bin = false; 1544 | src = [ 1545 | (fetchurl { 1546 | url = "http://registry.npmjs.org/lodash.repeat/-/lodash.repeat-3.0.0.tgz"; 1547 | name = "lodash.repeat-3.0.0.tgz"; 1548 | sha1 = "c340f4136c99dc5b2e397b3fd50cffbd172a94b0"; 1549 | }) 1550 | ]; 1551 | buildInputs = 1552 | (self.nativeDeps."lodash.repeat" or []); 1553 | deps = { 1554 | "lodash._basetostring-3.0.0" = self.by-version."lodash._basetostring"."3.0.0"; 1555 | }; 1556 | peerDependencies = [ 1557 | ]; 1558 | passthru.names = [ "lodash.repeat" ]; 1559 | }; 1560 | by-spec."lru-cache"."2" = 1561 | self.by-version."lru-cache"."2.5.2"; 1562 | by-version."lru-cache"."2.5.2" = lib.makeOverridable self.buildNodePackage { 1563 | name = "lru-cache-2.5.2"; 1564 | bin = false; 1565 | src = [ 1566 | (fetchurl { 1567 | url = "http://registry.npmjs.org/lru-cache/-/lru-cache-2.5.2.tgz"; 1568 | name = "lru-cache-2.5.2.tgz"; 1569 | sha1 = "1fddad938aae1263ce138680be1b3f591c0ab41c"; 1570 | }) 1571 | ]; 1572 | buildInputs = 1573 | (self.nativeDeps."lru-cache" or []); 1574 | deps = { 1575 | }; 1576 | peerDependencies = [ 1577 | ]; 1578 | passthru.names = [ "lru-cache" ]; 1579 | }; 1580 | by-spec."mime-db"."~1.8.0" = 1581 | self.by-version."mime-db"."1.8.0"; 1582 | by-version."mime-db"."1.8.0" = lib.makeOverridable self.buildNodePackage { 1583 | name = "mime-db-1.8.0"; 1584 | bin = false; 1585 | src = [ 1586 | (fetchurl { 1587 | url = "http://registry.npmjs.org/mime-db/-/mime-db-1.8.0.tgz"; 1588 | name = "mime-db-1.8.0.tgz"; 1589 | sha1 = "82a9b385f22b0f5954dec4d445faba0722c4ad25"; 1590 | }) 1591 | ]; 1592 | buildInputs = 1593 | (self.nativeDeps."mime-db" or []); 1594 | deps = { 1595 | }; 1596 | peerDependencies = [ 1597 | ]; 1598 | passthru.names = [ "mime-db" ]; 1599 | }; 1600 | by-spec."mime-types"."~2.0.1" = 1601 | self.by-version."mime-types"."2.0.10"; 1602 | by-version."mime-types"."2.0.10" = lib.makeOverridable self.buildNodePackage { 1603 | name = "mime-types-2.0.10"; 1604 | bin = false; 1605 | src = [ 1606 | (fetchurl { 1607 | url = "http://registry.npmjs.org/mime-types/-/mime-types-2.0.10.tgz"; 1608 | name = "mime-types-2.0.10.tgz"; 1609 | sha1 = "eacd81bb73cab2a77447549a078d4f2018c67b4d"; 1610 | }) 1611 | ]; 1612 | buildInputs = 1613 | (self.nativeDeps."mime-types" or []); 1614 | deps = { 1615 | "mime-db-1.8.0" = self.by-version."mime-db"."1.8.0"; 1616 | }; 1617 | peerDependencies = [ 1618 | ]; 1619 | passthru.names = [ "mime-types" ]; 1620 | }; 1621 | by-spec."mime-types"."~2.0.3" = 1622 | self.by-version."mime-types"."2.0.10"; 1623 | by-spec."minimatch"."1" = 1624 | self.by-version."minimatch"."1.0.0"; 1625 | by-version."minimatch"."1.0.0" = lib.makeOverridable self.buildNodePackage { 1626 | name = "minimatch-1.0.0"; 1627 | bin = false; 1628 | src = [ 1629 | (fetchurl { 1630 | url = "http://registry.npmjs.org/minimatch/-/minimatch-1.0.0.tgz"; 1631 | name = "minimatch-1.0.0.tgz"; 1632 | sha1 = "e0dd2120b49e1b724ce8d714c520822a9438576d"; 1633 | }) 1634 | ]; 1635 | buildInputs = 1636 | (self.nativeDeps."minimatch" or []); 1637 | deps = { 1638 | "lru-cache-2.5.2" = self.by-version."lru-cache"."2.5.2"; 1639 | "sigmund-1.0.0" = self.by-version."sigmund"."1.0.0"; 1640 | }; 1641 | peerDependencies = [ 1642 | ]; 1643 | passthru.names = [ "minimatch" ]; 1644 | }; 1645 | by-spec."minimatch"."^2.0.1" = 1646 | self.by-version."minimatch"."2.0.4"; 1647 | by-version."minimatch"."2.0.4" = lib.makeOverridable self.buildNodePackage { 1648 | name = "minimatch-2.0.4"; 1649 | bin = false; 1650 | src = [ 1651 | (fetchurl { 1652 | url = "http://registry.npmjs.org/minimatch/-/minimatch-2.0.4.tgz"; 1653 | name = "minimatch-2.0.4.tgz"; 1654 | sha1 = "83bea115803e7a097a78022427287edb762fafed"; 1655 | }) 1656 | ]; 1657 | buildInputs = 1658 | (self.nativeDeps."minimatch" or []); 1659 | deps = { 1660 | "brace-expansion-1.1.0" = self.by-version."brace-expansion"."1.1.0"; 1661 | }; 1662 | peerDependencies = [ 1663 | ]; 1664 | passthru.names = [ "minimatch" ]; 1665 | }; 1666 | by-spec."minimatch"."~0.2.11" = 1667 | self.by-version."minimatch"."0.2.14"; 1668 | by-version."minimatch"."0.2.14" = lib.makeOverridable self.buildNodePackage { 1669 | name = "minimatch-0.2.14"; 1670 | bin = false; 1671 | src = [ 1672 | (fetchurl { 1673 | url = "http://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz"; 1674 | name = "minimatch-0.2.14.tgz"; 1675 | sha1 = "c74e780574f63c6f9a090e90efbe6ef53a6a756a"; 1676 | }) 1677 | ]; 1678 | buildInputs = 1679 | (self.nativeDeps."minimatch" or []); 1680 | deps = { 1681 | "lru-cache-2.5.2" = self.by-version."lru-cache"."2.5.2"; 1682 | "sigmund-1.0.0" = self.by-version."sigmund"."1.0.0"; 1683 | }; 1684 | peerDependencies = [ 1685 | ]; 1686 | passthru.names = [ "minimatch" ]; 1687 | }; 1688 | by-spec."minimist"."0.0.8" = 1689 | self.by-version."minimist"."0.0.8"; 1690 | by-version."minimist"."0.0.8" = lib.makeOverridable self.buildNodePackage { 1691 | name = "minimist-0.0.8"; 1692 | bin = false; 1693 | src = [ 1694 | (fetchurl { 1695 | url = "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz"; 1696 | name = "minimist-0.0.8.tgz"; 1697 | sha1 = "857fcabfc3397d2625b8228262e86aa7a011b05d"; 1698 | }) 1699 | ]; 1700 | buildInputs = 1701 | (self.nativeDeps."minimist" or []); 1702 | deps = { 1703 | }; 1704 | peerDependencies = [ 1705 | ]; 1706 | passthru.names = [ "minimist" ]; 1707 | }; 1708 | by-spec."minimist"."~0.0.1" = 1709 | self.by-version."minimist"."0.0.10"; 1710 | by-version."minimist"."0.0.10" = lib.makeOverridable self.buildNodePackage { 1711 | name = "minimist-0.0.10"; 1712 | bin = false; 1713 | src = [ 1714 | (fetchurl { 1715 | url = "http://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz"; 1716 | name = "minimist-0.0.10.tgz"; 1717 | sha1 = "de3f98543dbf96082be48ad1a0c7cda836301dcf"; 1718 | }) 1719 | ]; 1720 | buildInputs = 1721 | (self.nativeDeps."minimist" or []); 1722 | deps = { 1723 | }; 1724 | peerDependencies = [ 1725 | ]; 1726 | passthru.names = [ "minimist" ]; 1727 | }; 1728 | by-spec."mkdirp"."0.3.0" = 1729 | self.by-version."mkdirp"."0.3.0"; 1730 | by-version."mkdirp"."0.3.0" = lib.makeOverridable self.buildNodePackage { 1731 | name = "mkdirp-0.3.0"; 1732 | bin = false; 1733 | src = [ 1734 | (fetchurl { 1735 | url = "http://registry.npmjs.org/mkdirp/-/mkdirp-0.3.0.tgz"; 1736 | name = "mkdirp-0.3.0.tgz"; 1737 | sha1 = "1bbf5ab1ba827af23575143490426455f481fe1e"; 1738 | }) 1739 | ]; 1740 | buildInputs = 1741 | (self.nativeDeps."mkdirp" or []); 1742 | deps = { 1743 | }; 1744 | peerDependencies = [ 1745 | ]; 1746 | passthru.names = [ "mkdirp" ]; 1747 | }; 1748 | by-spec."mkdirp"."0.5.0" = 1749 | self.by-version."mkdirp"."0.5.0"; 1750 | by-version."mkdirp"."0.5.0" = lib.makeOverridable self.buildNodePackage { 1751 | name = "mkdirp-0.5.0"; 1752 | bin = true; 1753 | src = [ 1754 | (fetchurl { 1755 | url = "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.0.tgz"; 1756 | name = "mkdirp-0.5.0.tgz"; 1757 | sha1 = "1d73076a6df986cd9344e15e71fcc05a4c9abf12"; 1758 | }) 1759 | ]; 1760 | buildInputs = 1761 | (self.nativeDeps."mkdirp" or []); 1762 | deps = { 1763 | "minimist-0.0.8" = self.by-version."minimist"."0.0.8"; 1764 | }; 1765 | peerDependencies = [ 1766 | ]; 1767 | passthru.names = [ "mkdirp" ]; 1768 | }; 1769 | by-spec."mkdirp".">=0.5 0" = 1770 | self.by-version."mkdirp"."0.5.0"; 1771 | by-spec."mkdirp"."^0.5.0" = 1772 | self.by-version."mkdirp"."0.5.0"; 1773 | by-spec."mocha"."~2.2.4" = 1774 | self.by-version."mocha"."2.2.4"; 1775 | by-version."mocha"."2.2.4" = lib.makeOverridable self.buildNodePackage { 1776 | name = "mocha-2.2.4"; 1777 | bin = true; 1778 | src = [ 1779 | (fetchurl { 1780 | url = "http://registry.npmjs.org/mocha/-/mocha-2.2.4.tgz"; 1781 | name = "mocha-2.2.4.tgz"; 1782 | sha1 = "192b0edc0e17e56613bc66e5fc7e81c00413a98d"; 1783 | }) 1784 | ]; 1785 | buildInputs = 1786 | (self.nativeDeps."mocha" or []); 1787 | deps = { 1788 | "commander-2.3.0" = self.by-version."commander"."2.3.0"; 1789 | "debug-2.0.0" = self.by-version."debug"."2.0.0"; 1790 | "diff-1.0.8" = self.by-version."diff"."1.0.8"; 1791 | "escape-string-regexp-1.0.2" = self.by-version."escape-string-regexp"."1.0.2"; 1792 | "glob-3.2.3" = self.by-version."glob"."3.2.3"; 1793 | "growl-1.8.1" = self.by-version."growl"."1.8.1"; 1794 | "jade-0.26.3" = self.by-version."jade"."0.26.3"; 1795 | "mkdirp-0.5.0" = self.by-version."mkdirp"."0.5.0"; 1796 | "supports-color-1.2.1" = self.by-version."supports-color"."1.2.1"; 1797 | }; 1798 | peerDependencies = [ 1799 | ]; 1800 | passthru.names = [ "mocha" ]; 1801 | }; 1802 | "mocha" = self.by-version."mocha"."2.2.4"; 1803 | by-spec."ms"."0.6.2" = 1804 | self.by-version."ms"."0.6.2"; 1805 | by-version."ms"."0.6.2" = lib.makeOverridable self.buildNodePackage { 1806 | name = "ms-0.6.2"; 1807 | bin = false; 1808 | src = [ 1809 | (fetchurl { 1810 | url = "http://registry.npmjs.org/ms/-/ms-0.6.2.tgz"; 1811 | name = "ms-0.6.2.tgz"; 1812 | sha1 = "d89c2124c6fdc1353d65a8b77bf1aac4b193708c"; 1813 | }) 1814 | ]; 1815 | buildInputs = 1816 | (self.nativeDeps."ms" or []); 1817 | deps = { 1818 | }; 1819 | peerDependencies = [ 1820 | ]; 1821 | passthru.names = [ "ms" ]; 1822 | }; 1823 | by-spec."nan"."^1.7.0" = 1824 | self.by-version."nan"."1.7.0"; 1825 | by-version."nan"."1.7.0" = lib.makeOverridable self.buildNodePackage { 1826 | name = "nan-1.7.0"; 1827 | bin = false; 1828 | src = [ 1829 | (fetchurl { 1830 | url = "http://registry.npmjs.org/nan/-/nan-1.7.0.tgz"; 1831 | name = "nan-1.7.0.tgz"; 1832 | sha1 = "755b997404e83cbe7bc08bc3c5c56291bce87438"; 1833 | }) 1834 | ]; 1835 | buildInputs = 1836 | (self.nativeDeps."nan" or []); 1837 | deps = { 1838 | }; 1839 | peerDependencies = [ 1840 | ]; 1841 | passthru.names = [ "nan" ]; 1842 | }; 1843 | "nan" = self.by-version."nan"."1.7.0"; 1844 | by-spec."node-gyp"."~1.0.3" = 1845 | self.by-version."node-gyp"."1.0.3"; 1846 | by-version."node-gyp"."1.0.3" = lib.makeOverridable self.buildNodePackage { 1847 | name = "node-gyp-1.0.3"; 1848 | bin = true; 1849 | src = [ 1850 | (fetchurl { 1851 | url = "http://registry.npmjs.org/node-gyp/-/node-gyp-1.0.3.tgz"; 1852 | name = "node-gyp-1.0.3.tgz"; 1853 | sha1 = "a2f63f2df0b1f6cc69fa54bce3cc298aa769cbd8"; 1854 | }) 1855 | ]; 1856 | buildInputs = 1857 | (self.nativeDeps."node-gyp" or []); 1858 | deps = { 1859 | "fstream-1.0.4" = self.by-version."fstream"."1.0.4"; 1860 | "glob-4.5.3" = self.by-version."glob"."4.5.3"; 1861 | "graceful-fs-3.0.6" = self.by-version."graceful-fs"."3.0.6"; 1862 | "minimatch-1.0.0" = self.by-version."minimatch"."1.0.0"; 1863 | "mkdirp-0.5.0" = self.by-version."mkdirp"."0.5.0"; 1864 | "nopt-3.0.1" = self.by-version."nopt"."3.0.1"; 1865 | "npmlog-1.2.0" = self.by-version."npmlog"."1.2.0"; 1866 | "osenv-0.1.0" = self.by-version."osenv"."0.1.0"; 1867 | "request-2.55.0" = self.by-version."request"."2.55.0"; 1868 | "rimraf-2.3.2" = self.by-version."rimraf"."2.3.2"; 1869 | "semver-4.3.3" = self.by-version."semver"."4.3.3"; 1870 | "tar-1.0.3" = self.by-version."tar"."1.0.3"; 1871 | "which-1.0.9" = self.by-version."which"."1.0.9"; 1872 | }; 1873 | peerDependencies = [ 1874 | ]; 1875 | passthru.names = [ "node-gyp" ]; 1876 | }; 1877 | "node-gyp" = self.by-version."node-gyp"."1.0.3"; 1878 | by-spec."node-uuid"."~1.4.0" = 1879 | self.by-version."node-uuid"."1.4.3"; 1880 | by-version."node-uuid"."1.4.3" = lib.makeOverridable self.buildNodePackage { 1881 | name = "node-uuid-1.4.3"; 1882 | bin = true; 1883 | src = [ 1884 | (fetchurl { 1885 | url = "http://registry.npmjs.org/node-uuid/-/node-uuid-1.4.3.tgz"; 1886 | name = "node-uuid-1.4.3.tgz"; 1887 | sha1 = "319bb7a56e7cb63f00b5c0cd7851cd4b4ddf1df9"; 1888 | }) 1889 | ]; 1890 | buildInputs = 1891 | (self.nativeDeps."node-uuid" or []); 1892 | deps = { 1893 | }; 1894 | peerDependencies = [ 1895 | ]; 1896 | passthru.names = [ "node-uuid" ]; 1897 | }; 1898 | by-spec."nopt"."2 || 3" = 1899 | self.by-version."nopt"."3.0.1"; 1900 | by-version."nopt"."3.0.1" = lib.makeOverridable self.buildNodePackage { 1901 | name = "nopt-3.0.1"; 1902 | bin = true; 1903 | src = [ 1904 | (fetchurl { 1905 | url = "http://registry.npmjs.org/nopt/-/nopt-3.0.1.tgz"; 1906 | name = "nopt-3.0.1.tgz"; 1907 | sha1 = "bce5c42446a3291f47622a370abbf158fbbacbfd"; 1908 | }) 1909 | ]; 1910 | buildInputs = 1911 | (self.nativeDeps."nopt" or []); 1912 | deps = { 1913 | "abbrev-1.0.5" = self.by-version."abbrev"."1.0.5"; 1914 | }; 1915 | peerDependencies = [ 1916 | ]; 1917 | passthru.names = [ "nopt" ]; 1918 | }; 1919 | by-spec."npmlog"."0 || 1" = 1920 | self.by-version."npmlog"."1.2.0"; 1921 | by-version."npmlog"."1.2.0" = lib.makeOverridable self.buildNodePackage { 1922 | name = "npmlog-1.2.0"; 1923 | bin = false; 1924 | src = [ 1925 | (fetchurl { 1926 | url = "http://registry.npmjs.org/npmlog/-/npmlog-1.2.0.tgz"; 1927 | name = "npmlog-1.2.0.tgz"; 1928 | sha1 = "b512f18ae8696a0192ada78ba00c06dbbd91bafb"; 1929 | }) 1930 | ]; 1931 | buildInputs = 1932 | (self.nativeDeps."npmlog" or []); 1933 | deps = { 1934 | "ansi-0.3.0" = self.by-version."ansi"."0.3.0"; 1935 | "are-we-there-yet-1.0.4" = self.by-version."are-we-there-yet"."1.0.4"; 1936 | "gauge-1.2.0" = self.by-version."gauge"."1.2.0"; 1937 | }; 1938 | peerDependencies = [ 1939 | ]; 1940 | passthru.names = [ "npmlog" ]; 1941 | }; 1942 | by-spec."oauth-sign"."~0.6.0" = 1943 | self.by-version."oauth-sign"."0.6.0"; 1944 | by-version."oauth-sign"."0.6.0" = lib.makeOverridable self.buildNodePackage { 1945 | name = "oauth-sign-0.6.0"; 1946 | bin = false; 1947 | src = [ 1948 | (fetchurl { 1949 | url = "http://registry.npmjs.org/oauth-sign/-/oauth-sign-0.6.0.tgz"; 1950 | name = "oauth-sign-0.6.0.tgz"; 1951 | sha1 = "7dbeae44f6ca454e1f168451d630746735813ce3"; 1952 | }) 1953 | ]; 1954 | buildInputs = 1955 | (self.nativeDeps."oauth-sign" or []); 1956 | deps = { 1957 | }; 1958 | peerDependencies = [ 1959 | ]; 1960 | passthru.names = [ "oauth-sign" ]; 1961 | }; 1962 | by-spec."once"."^1.3.0" = 1963 | self.by-version."once"."1.3.1"; 1964 | by-version."once"."1.3.1" = lib.makeOverridable self.buildNodePackage { 1965 | name = "once-1.3.1"; 1966 | bin = false; 1967 | src = [ 1968 | (fetchurl { 1969 | url = "http://registry.npmjs.org/once/-/once-1.3.1.tgz"; 1970 | name = "once-1.3.1.tgz"; 1971 | sha1 = "f3f3e4da5b7d27b5c732969ee3e67e729457b31f"; 1972 | }) 1973 | ]; 1974 | buildInputs = 1975 | (self.nativeDeps."once" or []); 1976 | deps = { 1977 | "wrappy-1.0.1" = self.by-version."wrappy"."1.0.1"; 1978 | }; 1979 | peerDependencies = [ 1980 | ]; 1981 | passthru.names = [ "once" ]; 1982 | }; 1983 | by-spec."optimist"."^0.6.1" = 1984 | self.by-version."optimist"."0.6.1"; 1985 | by-version."optimist"."0.6.1" = lib.makeOverridable self.buildNodePackage { 1986 | name = "optimist-0.6.1"; 1987 | bin = false; 1988 | src = [ 1989 | (fetchurl { 1990 | url = "http://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz"; 1991 | name = "optimist-0.6.1.tgz"; 1992 | sha1 = "da3ea74686fa21a19a111c326e90eb15a0196686"; 1993 | }) 1994 | ]; 1995 | buildInputs = 1996 | (self.nativeDeps."optimist" or []); 1997 | deps = { 1998 | "wordwrap-0.0.2" = self.by-version."wordwrap"."0.0.2"; 1999 | "minimist-0.0.10" = self.by-version."minimist"."0.0.10"; 2000 | }; 2001 | peerDependencies = [ 2002 | ]; 2003 | passthru.names = [ "optimist" ]; 2004 | }; 2005 | by-spec."osenv"."0" = 2006 | self.by-version."osenv"."0.1.0"; 2007 | by-version."osenv"."0.1.0" = lib.makeOverridable self.buildNodePackage { 2008 | name = "osenv-0.1.0"; 2009 | bin = false; 2010 | src = [ 2011 | (fetchurl { 2012 | url = "http://registry.npmjs.org/osenv/-/osenv-0.1.0.tgz"; 2013 | name = "osenv-0.1.0.tgz"; 2014 | sha1 = "61668121eec584955030b9f470b1d2309504bfcb"; 2015 | }) 2016 | ]; 2017 | buildInputs = 2018 | (self.nativeDeps."osenv" or []); 2019 | deps = { 2020 | }; 2021 | peerDependencies = [ 2022 | ]; 2023 | passthru.names = [ "osenv" ]; 2024 | }; 2025 | by-spec."punycode".">=0.2.0" = 2026 | self.by-version."punycode"."1.3.2"; 2027 | by-version."punycode"."1.3.2" = lib.makeOverridable self.buildNodePackage { 2028 | name = "punycode-1.3.2"; 2029 | bin = false; 2030 | src = [ 2031 | (fetchurl { 2032 | url = "http://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz"; 2033 | name = "punycode-1.3.2.tgz"; 2034 | sha1 = "9653a036fb7c1ee42342f2325cceefea3926c48d"; 2035 | }) 2036 | ]; 2037 | buildInputs = 2038 | (self.nativeDeps."punycode" or []); 2039 | deps = { 2040 | }; 2041 | peerDependencies = [ 2042 | ]; 2043 | passthru.names = [ "punycode" ]; 2044 | }; 2045 | by-spec."qs"."~2.4.0" = 2046 | self.by-version."qs"."2.4.1"; 2047 | by-version."qs"."2.4.1" = lib.makeOverridable self.buildNodePackage { 2048 | name = "qs-2.4.1"; 2049 | bin = false; 2050 | src = [ 2051 | (fetchurl { 2052 | url = "http://registry.npmjs.org/qs/-/qs-2.4.1.tgz"; 2053 | name = "qs-2.4.1.tgz"; 2054 | sha1 = "68cbaea971013426a80c1404fad6b1a6b1175245"; 2055 | }) 2056 | ]; 2057 | buildInputs = 2058 | (self.nativeDeps."qs" or []); 2059 | deps = { 2060 | }; 2061 | peerDependencies = [ 2062 | ]; 2063 | passthru.names = [ "qs" ]; 2064 | }; 2065 | by-spec."readable-stream"."^1.1.13" = 2066 | self.by-version."readable-stream"."1.1.13"; 2067 | by-version."readable-stream"."1.1.13" = lib.makeOverridable self.buildNodePackage { 2068 | name = "readable-stream-1.1.13"; 2069 | bin = false; 2070 | src = [ 2071 | (fetchurl { 2072 | url = "http://registry.npmjs.org/readable-stream/-/readable-stream-1.1.13.tgz"; 2073 | name = "readable-stream-1.1.13.tgz"; 2074 | sha1 = "f6eef764f514c89e2b9e23146a75ba106756d23e"; 2075 | }) 2076 | ]; 2077 | buildInputs = 2078 | (self.nativeDeps."readable-stream" or []); 2079 | deps = { 2080 | "core-util-is-1.0.1" = self.by-version."core-util-is"."1.0.1"; 2081 | "isarray-0.0.1" = self.by-version."isarray"."0.0.1"; 2082 | "string_decoder-0.10.31" = self.by-version."string_decoder"."0.10.31"; 2083 | "inherits-2.0.1" = self.by-version."inherits"."2.0.1"; 2084 | }; 2085 | peerDependencies = [ 2086 | ]; 2087 | passthru.names = [ "readable-stream" ]; 2088 | }; 2089 | by-spec."readable-stream"."~1.0.26" = 2090 | self.by-version."readable-stream"."1.0.33"; 2091 | by-version."readable-stream"."1.0.33" = lib.makeOverridable self.buildNodePackage { 2092 | name = "readable-stream-1.0.33"; 2093 | bin = false; 2094 | src = [ 2095 | (fetchurl { 2096 | url = "http://registry.npmjs.org/readable-stream/-/readable-stream-1.0.33.tgz"; 2097 | name = "readable-stream-1.0.33.tgz"; 2098 | sha1 = "3a360dd66c1b1d7fd4705389860eda1d0f61126c"; 2099 | }) 2100 | ]; 2101 | buildInputs = 2102 | (self.nativeDeps."readable-stream" or []); 2103 | deps = { 2104 | "core-util-is-1.0.1" = self.by-version."core-util-is"."1.0.1"; 2105 | "isarray-0.0.1" = self.by-version."isarray"."0.0.1"; 2106 | "string_decoder-0.10.31" = self.by-version."string_decoder"."0.10.31"; 2107 | "inherits-2.0.1" = self.by-version."inherits"."2.0.1"; 2108 | }; 2109 | peerDependencies = [ 2110 | ]; 2111 | passthru.names = [ "readable-stream" ]; 2112 | }; 2113 | by-spec."request"."2" = 2114 | self.by-version."request"."2.55.0"; 2115 | by-version."request"."2.55.0" = lib.makeOverridable self.buildNodePackage { 2116 | name = "request-2.55.0"; 2117 | bin = false; 2118 | src = [ 2119 | (fetchurl { 2120 | url = "http://registry.npmjs.org/request/-/request-2.55.0.tgz"; 2121 | name = "request-2.55.0.tgz"; 2122 | sha1 = "d75c1cdf679d76bb100f9bffe1fe551b5c24e93d"; 2123 | }) 2124 | ]; 2125 | buildInputs = 2126 | (self.nativeDeps."request" or []); 2127 | deps = { 2128 | "bl-0.9.4" = self.by-version."bl"."0.9.4"; 2129 | "caseless-0.9.0" = self.by-version."caseless"."0.9.0"; 2130 | "forever-agent-0.6.1" = self.by-version."forever-agent"."0.6.1"; 2131 | "form-data-0.2.0" = self.by-version."form-data"."0.2.0"; 2132 | "json-stringify-safe-5.0.0" = self.by-version."json-stringify-safe"."5.0.0"; 2133 | "mime-types-2.0.10" = self.by-version."mime-types"."2.0.10"; 2134 | "node-uuid-1.4.3" = self.by-version."node-uuid"."1.4.3"; 2135 | "qs-2.4.1" = self.by-version."qs"."2.4.1"; 2136 | "tunnel-agent-0.4.0" = self.by-version."tunnel-agent"."0.4.0"; 2137 | "tough-cookie-0.12.1" = self.by-version."tough-cookie"."0.12.1"; 2138 | "http-signature-0.10.1" = self.by-version."http-signature"."0.10.1"; 2139 | "oauth-sign-0.6.0" = self.by-version."oauth-sign"."0.6.0"; 2140 | "hawk-2.3.1" = self.by-version."hawk"."2.3.1"; 2141 | "aws-sign2-0.5.0" = self.by-version."aws-sign2"."0.5.0"; 2142 | "stringstream-0.0.4" = self.by-version."stringstream"."0.0.4"; 2143 | "combined-stream-0.0.7" = self.by-version."combined-stream"."0.0.7"; 2144 | "isstream-0.1.2" = self.by-version."isstream"."0.1.2"; 2145 | "har-validator-1.6.1" = self.by-version."har-validator"."1.6.1"; 2146 | }; 2147 | peerDependencies = [ 2148 | ]; 2149 | passthru.names = [ "request" ]; 2150 | }; 2151 | by-spec."resolve"."^0.6.3" = 2152 | self.by-version."resolve"."0.6.3"; 2153 | by-version."resolve"."0.6.3" = lib.makeOverridable self.buildNodePackage { 2154 | name = "resolve-0.6.3"; 2155 | bin = false; 2156 | src = [ 2157 | (fetchurl { 2158 | url = "http://registry.npmjs.org/resolve/-/resolve-0.6.3.tgz"; 2159 | name = "resolve-0.6.3.tgz"; 2160 | sha1 = "dd957982e7e736debdf53b58a4dd91754575dd46"; 2161 | }) 2162 | ]; 2163 | buildInputs = 2164 | (self.nativeDeps."resolve" or []); 2165 | deps = { 2166 | }; 2167 | peerDependencies = [ 2168 | ]; 2169 | passthru.names = [ "resolve" ]; 2170 | }; 2171 | by-spec."rimraf"."2" = 2172 | self.by-version."rimraf"."2.3.2"; 2173 | by-version."rimraf"."2.3.2" = lib.makeOverridable self.buildNodePackage { 2174 | name = "rimraf-2.3.2"; 2175 | bin = true; 2176 | src = [ 2177 | (fetchurl { 2178 | url = "http://registry.npmjs.org/rimraf/-/rimraf-2.3.2.tgz"; 2179 | name = "rimraf-2.3.2.tgz"; 2180 | sha1 = "7304bd9275c401b89103b106b3531c1ef0c02fe9"; 2181 | }) 2182 | ]; 2183 | buildInputs = 2184 | (self.nativeDeps."rimraf" or []); 2185 | deps = { 2186 | "glob-4.5.3" = self.by-version."glob"."4.5.3"; 2187 | }; 2188 | peerDependencies = [ 2189 | ]; 2190 | passthru.names = [ "rimraf" ]; 2191 | }; 2192 | by-spec."semver"."2.x || 3.x || 4" = 2193 | self.by-version."semver"."4.3.3"; 2194 | by-version."semver"."4.3.3" = lib.makeOverridable self.buildNodePackage { 2195 | name = "semver-4.3.3"; 2196 | bin = true; 2197 | src = [ 2198 | (fetchurl { 2199 | url = "http://registry.npmjs.org/semver/-/semver-4.3.3.tgz"; 2200 | name = "semver-4.3.3.tgz"; 2201 | sha1 = "15466b61220bc371cd8f0e666a9f785329ea8228"; 2202 | }) 2203 | ]; 2204 | buildInputs = 2205 | (self.nativeDeps."semver" or []); 2206 | deps = { 2207 | }; 2208 | peerDependencies = [ 2209 | ]; 2210 | passthru.names = [ "semver" ]; 2211 | }; 2212 | by-spec."sigmund"."~1.0.0" = 2213 | self.by-version."sigmund"."1.0.0"; 2214 | by-version."sigmund"."1.0.0" = lib.makeOverridable self.buildNodePackage { 2215 | name = "sigmund-1.0.0"; 2216 | bin = false; 2217 | src = [ 2218 | (fetchurl { 2219 | url = "http://registry.npmjs.org/sigmund/-/sigmund-1.0.0.tgz"; 2220 | name = "sigmund-1.0.0.tgz"; 2221 | sha1 = "66a2b3a749ae8b5fb89efd4fcc01dc94fbe02296"; 2222 | }) 2223 | ]; 2224 | buildInputs = 2225 | (self.nativeDeps."sigmund" or []); 2226 | deps = { 2227 | }; 2228 | peerDependencies = [ 2229 | ]; 2230 | passthru.names = [ "sigmund" ]; 2231 | }; 2232 | by-spec."sntp"."1.x.x" = 2233 | self.by-version."sntp"."1.0.9"; 2234 | by-version."sntp"."1.0.9" = lib.makeOverridable self.buildNodePackage { 2235 | name = "sntp-1.0.9"; 2236 | bin = false; 2237 | src = [ 2238 | (fetchurl { 2239 | url = "http://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz"; 2240 | name = "sntp-1.0.9.tgz"; 2241 | sha1 = "6541184cc90aeea6c6e7b35e2659082443c66198"; 2242 | }) 2243 | ]; 2244 | buildInputs = 2245 | (self.nativeDeps."sntp" or []); 2246 | deps = { 2247 | "hoek-2.12.0" = self.by-version."hoek"."2.12.0"; 2248 | }; 2249 | peerDependencies = [ 2250 | ]; 2251 | passthru.names = [ "sntp" ]; 2252 | }; 2253 | by-spec."string_decoder"."~0.10.x" = 2254 | self.by-version."string_decoder"."0.10.31"; 2255 | by-version."string_decoder"."0.10.31" = lib.makeOverridable self.buildNodePackage { 2256 | name = "string_decoder-0.10.31"; 2257 | bin = false; 2258 | src = [ 2259 | (fetchurl { 2260 | url = "http://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz"; 2261 | name = "string_decoder-0.10.31.tgz"; 2262 | sha1 = "62e203bc41766c6c28c9fc84301dab1c5310fa94"; 2263 | }) 2264 | ]; 2265 | buildInputs = 2266 | (self.nativeDeps."string_decoder" or []); 2267 | deps = { 2268 | }; 2269 | peerDependencies = [ 2270 | ]; 2271 | passthru.names = [ "string_decoder" ]; 2272 | }; 2273 | by-spec."stringstream"."~0.0.4" = 2274 | self.by-version."stringstream"."0.0.4"; 2275 | by-version."stringstream"."0.0.4" = lib.makeOverridable self.buildNodePackage { 2276 | name = "stringstream-0.0.4"; 2277 | bin = false; 2278 | src = [ 2279 | (fetchurl { 2280 | url = "http://registry.npmjs.org/stringstream/-/stringstream-0.0.4.tgz"; 2281 | name = "stringstream-0.0.4.tgz"; 2282 | sha1 = "0f0e3423f942960b5692ac324a57dd093bc41a92"; 2283 | }) 2284 | ]; 2285 | buildInputs = 2286 | (self.nativeDeps."stringstream" or []); 2287 | deps = { 2288 | }; 2289 | peerDependencies = [ 2290 | ]; 2291 | passthru.names = [ "stringstream" ]; 2292 | }; 2293 | by-spec."strip-ansi"."^2.0.1" = 2294 | self.by-version."strip-ansi"."2.0.1"; 2295 | by-version."strip-ansi"."2.0.1" = lib.makeOverridable self.buildNodePackage { 2296 | name = "strip-ansi-2.0.1"; 2297 | bin = true; 2298 | src = [ 2299 | (fetchurl { 2300 | url = "http://registry.npmjs.org/strip-ansi/-/strip-ansi-2.0.1.tgz"; 2301 | name = "strip-ansi-2.0.1.tgz"; 2302 | sha1 = "df62c1aa94ed2f114e1d0f21fd1d50482b79a60e"; 2303 | }) 2304 | ]; 2305 | buildInputs = 2306 | (self.nativeDeps."strip-ansi" or []); 2307 | deps = { 2308 | "ansi-regex-1.1.1" = self.by-version."ansi-regex"."1.1.1"; 2309 | }; 2310 | peerDependencies = [ 2311 | ]; 2312 | passthru.names = [ "strip-ansi" ]; 2313 | }; 2314 | by-spec."supports-color"."^1.3.0" = 2315 | self.by-version."supports-color"."1.3.1"; 2316 | by-version."supports-color"."1.3.1" = lib.makeOverridable self.buildNodePackage { 2317 | name = "supports-color-1.3.1"; 2318 | bin = true; 2319 | src = [ 2320 | (fetchurl { 2321 | url = "http://registry.npmjs.org/supports-color/-/supports-color-1.3.1.tgz"; 2322 | name = "supports-color-1.3.1.tgz"; 2323 | sha1 = "15758df09d8ff3b4acc307539fabe27095e1042d"; 2324 | }) 2325 | ]; 2326 | buildInputs = 2327 | (self.nativeDeps."supports-color" or []); 2328 | deps = { 2329 | }; 2330 | peerDependencies = [ 2331 | ]; 2332 | passthru.names = [ "supports-color" ]; 2333 | }; 2334 | by-spec."supports-color"."~1.2.0" = 2335 | self.by-version."supports-color"."1.2.1"; 2336 | by-version."supports-color"."1.2.1" = lib.makeOverridable self.buildNodePackage { 2337 | name = "supports-color-1.2.1"; 2338 | bin = true; 2339 | src = [ 2340 | (fetchurl { 2341 | url = "http://registry.npmjs.org/supports-color/-/supports-color-1.2.1.tgz"; 2342 | name = "supports-color-1.2.1.tgz"; 2343 | sha1 = "12ee21507086cd98c1058d9ec0f4ac476b7af3b2"; 2344 | }) 2345 | ]; 2346 | buildInputs = 2347 | (self.nativeDeps."supports-color" or []); 2348 | deps = { 2349 | }; 2350 | peerDependencies = [ 2351 | ]; 2352 | passthru.names = [ "supports-color" ]; 2353 | }; 2354 | by-spec."tar"."^1.0.0" = 2355 | self.by-version."tar"."1.0.3"; 2356 | by-version."tar"."1.0.3" = lib.makeOverridable self.buildNodePackage { 2357 | name = "tar-1.0.3"; 2358 | bin = false; 2359 | src = [ 2360 | (fetchurl { 2361 | url = "http://registry.npmjs.org/tar/-/tar-1.0.3.tgz"; 2362 | name = "tar-1.0.3.tgz"; 2363 | sha1 = "15bcdab244fa4add44e4244a0176edb8aa9a2b44"; 2364 | }) 2365 | ]; 2366 | buildInputs = 2367 | (self.nativeDeps."tar" or []); 2368 | deps = { 2369 | "block-stream-0.0.7" = self.by-version."block-stream"."0.0.7"; 2370 | "fstream-1.0.4" = self.by-version."fstream"."1.0.4"; 2371 | "inherits-2.0.1" = self.by-version."inherits"."2.0.1"; 2372 | }; 2373 | peerDependencies = [ 2374 | ]; 2375 | passthru.names = [ "tar" ]; 2376 | }; 2377 | by-spec."tough-cookie".">=0.12.0" = 2378 | self.by-version."tough-cookie"."0.12.1"; 2379 | by-version."tough-cookie"."0.12.1" = lib.makeOverridable self.buildNodePackage { 2380 | name = "tough-cookie-0.12.1"; 2381 | bin = false; 2382 | src = [ 2383 | (fetchurl { 2384 | url = "http://registry.npmjs.org/tough-cookie/-/tough-cookie-0.12.1.tgz"; 2385 | name = "tough-cookie-0.12.1.tgz"; 2386 | sha1 = "8220c7e21abd5b13d96804254bd5a81ebf2c7d62"; 2387 | }) 2388 | ]; 2389 | buildInputs = 2390 | (self.nativeDeps."tough-cookie" or []); 2391 | deps = { 2392 | "punycode-1.3.2" = self.by-version."punycode"."1.3.2"; 2393 | }; 2394 | peerDependencies = [ 2395 | ]; 2396 | passthru.names = [ "tough-cookie" ]; 2397 | }; 2398 | by-spec."tunnel-agent"."~0.4.0" = 2399 | self.by-version."tunnel-agent"."0.4.0"; 2400 | by-version."tunnel-agent"."0.4.0" = lib.makeOverridable self.buildNodePackage { 2401 | name = "tunnel-agent-0.4.0"; 2402 | bin = false; 2403 | src = [ 2404 | (fetchurl { 2405 | url = "http://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.0.tgz"; 2406 | name = "tunnel-agent-0.4.0.tgz"; 2407 | sha1 = "b1184e312ffbcf70b3b4c78e8c219de7ebb1c550"; 2408 | }) 2409 | ]; 2410 | buildInputs = 2411 | (self.nativeDeps."tunnel-agent" or []); 2412 | deps = { 2413 | }; 2414 | peerDependencies = [ 2415 | ]; 2416 | passthru.names = [ "tunnel-agent" ]; 2417 | }; 2418 | by-spec."type-detect"."0.1.1" = 2419 | self.by-version."type-detect"."0.1.1"; 2420 | by-version."type-detect"."0.1.1" = lib.makeOverridable self.buildNodePackage { 2421 | name = "type-detect-0.1.1"; 2422 | bin = false; 2423 | src = [ 2424 | (fetchurl { 2425 | url = "http://registry.npmjs.org/type-detect/-/type-detect-0.1.1.tgz"; 2426 | name = "type-detect-0.1.1.tgz"; 2427 | sha1 = "0ba5ec2a885640e470ea4e8505971900dac58822"; 2428 | }) 2429 | ]; 2430 | buildInputs = 2431 | (self.nativeDeps."type-detect" or []); 2432 | deps = { 2433 | }; 2434 | peerDependencies = [ 2435 | ]; 2436 | passthru.names = [ "type-detect" ]; 2437 | }; 2438 | by-spec."which"."1" = 2439 | self.by-version."which"."1.0.9"; 2440 | by-version."which"."1.0.9" = lib.makeOverridable self.buildNodePackage { 2441 | name = "which-1.0.9"; 2442 | bin = true; 2443 | src = [ 2444 | (fetchurl { 2445 | url = "http://registry.npmjs.org/which/-/which-1.0.9.tgz"; 2446 | name = "which-1.0.9.tgz"; 2447 | sha1 = "460c1da0f810103d0321a9b633af9e575e64486f"; 2448 | }) 2449 | ]; 2450 | buildInputs = 2451 | (self.nativeDeps."which" or []); 2452 | deps = { 2453 | }; 2454 | peerDependencies = [ 2455 | ]; 2456 | passthru.names = [ "which" ]; 2457 | }; 2458 | by-spec."wordwrap"."~0.0.2" = 2459 | self.by-version."wordwrap"."0.0.2"; 2460 | by-version."wordwrap"."0.0.2" = lib.makeOverridable self.buildNodePackage { 2461 | name = "wordwrap-0.0.2"; 2462 | bin = false; 2463 | src = [ 2464 | (fetchurl { 2465 | url = "http://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz"; 2466 | name = "wordwrap-0.0.2.tgz"; 2467 | sha1 = "b79669bb42ecb409f83d583cad52ca17eaa1643f"; 2468 | }) 2469 | ]; 2470 | buildInputs = 2471 | (self.nativeDeps."wordwrap" or []); 2472 | deps = { 2473 | }; 2474 | peerDependencies = [ 2475 | ]; 2476 | passthru.names = [ "wordwrap" ]; 2477 | }; 2478 | by-spec."wrappy"."1" = 2479 | self.by-version."wrappy"."1.0.1"; 2480 | by-version."wrappy"."1.0.1" = lib.makeOverridable self.buildNodePackage { 2481 | name = "wrappy-1.0.1"; 2482 | bin = false; 2483 | src = [ 2484 | (fetchurl { 2485 | url = "http://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz"; 2486 | name = "wrappy-1.0.1.tgz"; 2487 | sha1 = "1e65969965ccbc2db4548c6b84a6f2c5aedd4739"; 2488 | }) 2489 | ]; 2490 | buildInputs = 2491 | (self.nativeDeps."wrappy" or []); 2492 | deps = { 2493 | }; 2494 | peerDependencies = [ 2495 | ]; 2496 | passthru.names = [ "wrappy" ]; 2497 | }; 2498 | by-spec."xtend"."^4.0.0" = 2499 | self.by-version."xtend"."4.0.0"; 2500 | by-version."xtend"."4.0.0" = lib.makeOverridable self.buildNodePackage { 2501 | name = "xtend-4.0.0"; 2502 | bin = false; 2503 | src = [ 2504 | (fetchurl { 2505 | url = "http://registry.npmjs.org/xtend/-/xtend-4.0.0.tgz"; 2506 | name = "xtend-4.0.0.tgz"; 2507 | sha1 = "8bc36ff87aedbe7ce9eaf0bca36b2354a743840f"; 2508 | }) 2509 | ]; 2510 | buildInputs = 2511 | (self.nativeDeps."xtend" or []); 2512 | deps = { 2513 | }; 2514 | peerDependencies = [ 2515 | ]; 2516 | passthru.names = [ "xtend" ]; 2517 | }; 2518 | } 2519 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "plc", 3 | "version": "0.3.0", 4 | "main": "./lib/plc", 5 | "description": "module to connect to PLCs", 6 | "keywords": [ 7 | "plc", 8 | "libnodave", 9 | "siemens", 10 | "logo" 11 | ], 12 | "author": "Markus Kohlhase ", 13 | "licenses": [ 14 | { 15 | "type": "LGPL" 16 | } 17 | ], 18 | "engines": { 19 | "node": ">=0.10.x" 20 | }, 21 | "gypfile": true, 22 | "dependencies": { 23 | "bindings": "^1.2.1", 24 | "bits": "~0.1.1", 25 | "nan": "^2.5.1" 26 | }, 27 | "devDependencies": { 28 | "chai": "~3.5.0", 29 | "coffee-script": "~1.12.4", 30 | "coffeelint": "^1.16.0", 31 | "mocha": "~3.2.0", 32 | "node-gyp": "~3.5.0" 33 | }, 34 | "repository": { 35 | "type": "git", 36 | "url": "git://github.com/flosse/node-plc.git" 37 | }, 38 | "bugs": "http://github.com/flosse/node-plc/issues", 39 | "scripts": { 40 | "lint": "coffeelint src/", 41 | "install": "node-gyp configure build", 42 | "prepublish": "coffee -c -o lib/ src/*.coffee", 43 | "test": "npm run lint & npm install && mocha --reporter spec --compilers coffee:coffee-script/register spec/*.spec.coffee" 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /spec/logo.spec.coffee: -------------------------------------------------------------------------------- 1 | should = require("chai").should() 2 | Logo = require "../src/logo" 3 | 4 | { EventEmitter } = require 'events' 5 | 6 | describe "logo", -> 7 | 8 | it "is a class", -> 9 | Logo.should.be.a.function 10 | 11 | describe "constructor", -> 12 | 13 | it "takes an IP Address as first argument", -> 14 | (-> new Logo "192.168.0.1").should.not.throw() 15 | (-> new Logo).should.throw() 16 | 17 | it "takes an option object as second argument", -> 18 | (-> new Logo "192.168.0.1", {}).should.not.throw() 19 | (new Logo "192.168.0.1", inputs: 2).inputs.should.equal 2 20 | (new Logo "192.168.0.1", markers: 3).markers.should.equal 3 21 | (new Logo "192.168.0.1", timeout: 500).timeout.should.equal 500 22 | (new Logo "192.168.0.1", simulate: yes).simulate.should.be.true 23 | 24 | it "uses 8 inputs and 8 markers as default config", -> 25 | (new Logo "192.168.0.1").inputs.should.equal 8 26 | (new Logo "192.168.0.1").markers.should.equal 8 27 | 28 | it "is an EventEmitter", -> 29 | (new Logo "192.168.7.3").should.be.an.instanceof EventEmitter 30 | 31 | describe "Logo class", -> 32 | 33 | beforeEach -> @logo = new Logo "192.168.0.1" 34 | 35 | it "has an 'ip' property", -> 36 | @logo.ip.should.be.a.string 37 | 38 | it "has a connect method", -> 39 | @logo.connect.should.be.a.function 40 | 41 | it "has a disconnect method", -> 42 | @logo.disconnect.should.be.a.function 43 | 44 | it "has a setMarker method", -> 45 | @logo.setMarker.should.be.a.function 46 | 47 | it "has a getMarker method", -> 48 | @logo.getMarker.should.be.a.function 49 | 50 | it "has a startWatching method", -> 51 | @logo.startWatching.should.be.a.function 52 | 53 | it "has a stopWatching method", -> 54 | @logo.stopWatching.should.be.a.function 55 | 56 | it "has a getState method", -> 57 | @logo.getState.should.be.a.function 58 | 59 | it "has a triggerAction method", -> 60 | @logo.triggerAction.should.be.a.function 61 | 62 | it "has a setVirtualState method", -> 63 | @logo.setVirtualState.should.be.a.function 64 | 65 | it "has a setSimulatedState method", -> 66 | @logo.setSimulatedState.should.be.a.function 67 | 68 | describe "getMarkers method", -> 69 | 70 | it "is a function", -> 71 | @logo.getMarkers.should.be.a.function 72 | 73 | it "returns an error if the logo is disconnected", -> 74 | @logo.getMarkers().should.be.an.Error 75 | 76 | it "has a getInput method", -> 77 | @logo.getInput.should.be.a.function 78 | 79 | describe "getInput method", -> 80 | 81 | it "is a function", -> 82 | @logo.getInputs.should.be.a.function 83 | 84 | it "returns an error if the logo is disconnected", -> 85 | @logo.getInputs().should.be.an.Error 86 | -------------------------------------------------------------------------------- /spec/nodave.spec.coffee: -------------------------------------------------------------------------------- 1 | should = require("chai").should() 2 | nodave = (require "bindings")("addon").NoDave 3 | 4 | describe "nodave", -> 5 | 6 | before -> 7 | 8 | it "is a class", -> 9 | nodave.should.be.a.function 10 | 11 | describe "class", -> 12 | 13 | beforeEach -> @d = new nodave "192.168.0.1" 14 | 15 | it "has a connect method", -> 16 | @d.connect.should.be.a.function 17 | 18 | it "has a method to get markers", -> 19 | @d.getMarkers.should.be.a.function 20 | 21 | it "has a method to set markers", -> 22 | @d.setMarkers.should.be.a.function 23 | 24 | it "has a method to get inputs", -> 25 | @d.getInputs.should.be.a.function 26 | -------------------------------------------------------------------------------- /spec/plc.spec.coffee: -------------------------------------------------------------------------------- 1 | should = require("chai").should() 2 | pkg = require '../package.json' 3 | plc = require "../src/plc" 4 | 5 | describe "plc", -> 6 | 7 | it "contains the logo class", -> 8 | plc.Logo.should.be.a.function 9 | 10 | it "has a version property", -> 11 | plc.VERSION.should.be.a.string 12 | plc.VERSION.should.equal pkg.version 13 | -------------------------------------------------------------------------------- /src/addon.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include "node_nodave.h" 3 | 4 | using namespace v8; 5 | 6 | NAN_MODULE_INIT(InitAll) { 7 | NoDave::Init(target); 8 | } 9 | 10 | NODE_MODULE(addon, InitAll) 11 | -------------------------------------------------------------------------------- /src/libnodave/libnodave.gyp: -------------------------------------------------------------------------------- 1 | { 2 | 'targets': [ 3 | { 4 | 'target_name': 'nodave', 5 | 'product_prefix': 'lib', 6 | 'type': 'static_library', 7 | 'sources': [ 8 | 'nodave.c' 9 | ], 10 | 'defines': [ 11 | 'LINUX', 12 | 'DAVE_LITTLE_ENDIAN' 13 | ], 14 | 'include_dirs': [ 15 | '.', 16 | ], 17 | 'direct_dependent_settings': { 18 | 'include_dirs': [ 19 | '.', 20 | ], 21 | }, 22 | } 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /src/libnodave/log2.h: -------------------------------------------------------------------------------- 1 | #ifndef __log 2 | #define __log 3 | 4 | #ifdef LINUX 5 | #define HAVE_PRINTF 6 | #define logout stdout 7 | #endif 8 | 9 | #ifdef BCCWIN 10 | #define HAVE_PRINTF 11 | #define logout stdout 12 | #endif 13 | 14 | #ifdef KEILC51 15 | 16 | #endif 17 | 18 | #ifdef DOS 19 | #define HAVE_PRINTF 20 | #define logout stdout 21 | #endif 22 | 23 | #ifdef AVR 24 | #define NO_PRINT_CODE 25 | #endif 26 | 27 | 28 | #ifdef HAVE_PRINTF 29 | #define LOG1(x) fprintf(logout,x) 30 | #define LOG2(x,y) fprintf(logout,x,y) 31 | #define LOG3(a,b,c) fprintf(logout,a,b,c) 32 | #define LOG4(a,b,c,d) fprintf(logout,a,b,c,d) 33 | #define LOG5(a,b,c,d,e) fprintf(logout,a,b,c,d,e) 34 | #define LOG6(a,b,c,d,e,f) fprintf(logout,a,b,c,d,e,f) 35 | #define LOG7(a,b,c,d,e,f,g) fprintf(logout,a,b,c,d,e,f,g) 36 | #define FLUSH fflush(logout) 37 | 38 | #define LOG_1(a) fprintf(logout,a) 39 | #define LOG_2(a,b) fprintf(logout,a,b) 40 | #endif /* HAVE_PRINTF */ 41 | 42 | #ifdef NO_PRINT_CODE 43 | #define LOG1(x) 44 | #define LOG2(x,y) 45 | #define LOG3(a,b,c) 46 | #define LOG4(a,b,c,d) 47 | #define LOG5(a,b,c,d,e) 48 | #define LOG6(a,b,c,d,e,f) 49 | #define LOG7(a,b,c,d,e,f,g) 50 | #define FLUSH 51 | 52 | #define LOG_1(a) 53 | #define LOG_2(a,b) 54 | #endif /* NO_PRINT_CODE */ 55 | 56 | 57 | #endif /* __log */ 58 | -------------------------------------------------------------------------------- /src/libnodave/nodave.h: -------------------------------------------------------------------------------- 1 | /* 2 | Part of Libnodave, a free communication libray for Siemens S7 200/300/400 via 3 | the MPI adapter 6ES7 972-0CA22-0XAC 4 | or MPI adapter 6ES7 972-0CA23-0XAC 5 | or TS adapter 6ES7 972-0CA33-0XAC 6 | or MPI adapter 6ES7 972-0CA11-0XAC, 7 | IBH/MHJ-NetLink or CPs 243, 343 and 443 8 | or VIPA Speed7 with builtin ethernet support. 9 | 10 | (C) Thomas Hergenhahn (thomas.hergenhahn@web.de) 2002..2005 11 | 12 | Libnodave is free software; you can redistribute it and/or modify 13 | it under the terms of the GNU Library General Public License as published by 14 | the Free Software Foundation; either version 2, or (at your option) 15 | any later version. 16 | 17 | Libnodave is distributed in the hope that it will be useful, 18 | but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | GNU General Public License for more details. 21 | 22 | You should have received a copy of the GNU Library General Public License 23 | along with Libnodave; see the file COPYING. If not, write to 24 | the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 25 | */ 26 | 27 | #ifdef __cplusplus 28 | 29 | extern "C" { 30 | #endif 31 | 32 | #ifndef __nodave 33 | #define __nodave 34 | 35 | #define daveSerialConnection 0 36 | #define daveTcpConnection 1 37 | #define daveS7OnlineConnection 2 38 | 39 | #ifdef LINUX 40 | #define DECL2 41 | #define EXPORTSPEC 42 | typedef struct dost { 43 | int rfd; 44 | int wfd; 45 | // int connectionType; 46 | } _daveOSserialType; 47 | #include 48 | #define tmotype int 49 | #define OS_KNOWN // get rid of nested ifdefs. 50 | #endif 51 | 52 | #ifdef BCCWIN 53 | #define WIN32_LEAN_AND_MEAN 54 | #include 55 | #include 56 | #include 57 | #define DECL2 __stdcall 58 | #define tmotype int 59 | 60 | #ifdef DOEXPORT 61 | #define EXPORTSPEC __declspec (dllexport) 62 | #else 63 | #define EXPORTSPEC __declspec (dllimport) 64 | #endif 65 | 66 | typedef struct dost { 67 | HANDLE rfd; 68 | HANDLE wfd; 69 | // int connectionType; 70 | } _daveOSserialType; 71 | 72 | #define OS_KNOWN 73 | #endif 74 | 75 | #ifdef DOS 76 | #include 77 | #include 78 | //#define DECL2 WINAPI 79 | // #define DECL2 80 | #define DECL2 __cedcl 81 | #define EXPORTSPEC 82 | 83 | typedef struct dost { 84 | int rfd; 85 | int wfd; 86 | int connectionType; 87 | } _daveOSserialType; 88 | #define OS_KNOWN 89 | #endif 90 | 91 | #ifdef AVR 92 | #include 93 | #include 94 | #define DECL2 95 | #define EXPORTSPEC 96 | typedef struct dost { 97 | int rfd; 98 | int wfd; 99 | int connectionType; 100 | } _daveOSserialType; 101 | #define tmotype long 102 | #define OS_KNOWN 103 | #endif 104 | 105 | #ifndef OS_KNOWN 106 | #error Fill in what you need for your OS or API. 107 | #endif 108 | 109 | /* 110 | some frequently used ASCII control codes: 111 | */ 112 | #define DLE 0x10 113 | #define ETX 0x03 114 | #define STX 0x02 115 | #define SYN 0x16 116 | #define NAK 0x15 117 | #define EOT 0x04 // for S5 118 | #define ACK 0x06 // for S5 119 | /* 120 | Protocol types to be used with newInterface: 121 | */ 122 | #define daveProtoMPI 0 /* MPI for S7 300/400 */ 123 | #define daveProtoMPI2 1 /* MPI for S7 300/400, "Andrew's version" without STX */ 124 | #define daveProtoMPI3 2 /* MPI for S7 300/400, Step 7 Version, not yet implemented */ 125 | #define daveProtoMPI4 3 /* MPI for S7 300/400, "Andrew's version" with STX */ 126 | 127 | #define daveProtoPPI 10 /* PPI for S7 200 */ 128 | 129 | #define daveProtoAS511 20 /* S5 programming port protocol */ 130 | 131 | #define daveProtoS7online 50 /* use s7onlinx.dll for transport */ 132 | 133 | #define daveProtoISOTCP 122 /* ISO over TCP */ 134 | #define daveProtoISOTCP243 123 /* ISO over TCP with CP243 */ 135 | #define daveProtoISOTCPR 124 /* ISO over TCP with Routing */ 136 | 137 | #define daveProtoMPI_IBH 223 /* MPI with IBH NetLink MPI to ethernet gateway */ 138 | #define daveProtoPPI_IBH 224 /* PPI with IBH NetLink PPI to ethernet gateway */ 139 | 140 | #define daveProtoNLpro 230 /* MPI with NetLink Pro MPI to ethernet gateway */ 141 | 142 | #define daveProtoUserTransport 255 /* Libnodave will pass the PDUs of S7 Communication to user */ 143 | /* defined call back functions. */ 144 | 145 | /* 146 | * ProfiBus speed constants: 147 | */ 148 | #define daveSpeed9k 0 149 | #define daveSpeed19k 1 150 | #define daveSpeed187k 2 151 | #define daveSpeed500k 3 152 | #define daveSpeed1500k 4 153 | #define daveSpeed45k 5 154 | #define daveSpeed93k 6 155 | 156 | /* 157 | Some MPI function codes (yet unused ones may be incorrect). 158 | */ 159 | #define daveFuncOpenS7Connection 0xF0 160 | #define daveFuncRead 0x04 161 | #define daveFuncWrite 0x05 162 | #define daveFuncRequestDownload 0x1A 163 | #define daveFuncDownloadBlock 0x1B 164 | #define daveFuncDownloadEnded 0x1C 165 | #define daveFuncStartUpload 0x1D 166 | #define daveFuncUpload 0x1E 167 | #define daveFuncEndUpload 0x1F 168 | #define daveFuncInsertBlock 0x28 169 | /* 170 | S7 specific constants: 171 | */ 172 | #define daveBlockType_OB '8' 173 | #define daveBlockType_DB 'A' 174 | #define daveBlockType_SDB 'B' 175 | #define daveBlockType_FC 'C' 176 | #define daveBlockType_SFC 'D' 177 | #define daveBlockType_FB 'E' 178 | #define daveBlockType_SFB 'F' 179 | 180 | #define daveS5BlockType_DB 0x01 181 | #define daveS5BlockType_SB 0x02 182 | #define daveS5BlockType_PB 0x04 183 | #define daveS5BlockType_FX 0x05 184 | #define daveS5BlockType_FB 0x08 185 | #define daveS5BlockType_DX 0x0C 186 | #define daveS5BlockType_OB 0x10 187 | 188 | /* 189 | Use these constants for parameter "area" in daveReadBytes and daveWriteBytes 190 | */ 191 | #define daveSysInfo 0x3 /* System info of 200 family */ 192 | #define daveSysFlags 0x5 /* System flags of 200 family */ 193 | #define daveAnaIn 0x6 /* analog inputs of 200 family */ 194 | #define daveAnaOut 0x7 /* analog outputs of 200 family */ 195 | 196 | #define daveP 0x80 /* direct peripheral access */ 197 | #define daveInputs 0x81 198 | #define daveOutputs 0x82 199 | #define daveFlags 0x83 200 | #define daveDB 0x84 /* data blocks */ 201 | #define daveDI 0x85 /* instance data blocks */ 202 | #define daveLocal 0x86 /* not tested */ 203 | #define daveV 0x87 /* don't know what it is */ 204 | #define daveCounter 28 /* S7 counters */ 205 | #define daveTimer 29 /* S7 timers */ 206 | #define daveCounter200 30 /* IEC counters (200 family) */ 207 | #define daveTimer200 31 /* IEC timers (200 family) */ 208 | #define daveSysDataS5 0x86 /* system data area ? */ 209 | #define daveRawMemoryS5 0 /* just the raw memory */ 210 | 211 | /** 212 | Library specific: 213 | **/ 214 | /* 215 | Result codes. Genarally, 0 means ok, 216 | >0 are results (also errors) reported by the PLC 217 | <0 means error reported by library code. 218 | */ 219 | #define daveResOK 0 /* means all ok */ 220 | #define daveResNoPeripheralAtAddress 1 /* CPU tells there is no peripheral at address */ 221 | #define daveResMultipleBitsNotSupported 6 /* CPU tells it does not support to read a bit block with a */ 222 | /* length other than 1 bit. */ 223 | #define daveResItemNotAvailable200 3 /* means a a piece of data is not available in the CPU, e.g. */ 224 | /* when trying to read a non existing DB or bit bloc of length<>1 */ 225 | /* This code seems to be specific to 200 family. */ 226 | 227 | #define daveResItemNotAvailable 10 /* means a a piece of data is not available in the CPU, e.g. */ 228 | /* when trying to read a non existing DB */ 229 | 230 | #define daveAddressOutOfRange 5 /* means the data address is beyond the CPUs address range */ 231 | #define daveWriteDataSizeMismatch 7 /* means the write data size doesn't fit item size */ 232 | #define daveResCannotEvaluatePDU -123 /* PDU is not understood by libnodave */ 233 | #define daveResCPUNoData -124 234 | #define daveUnknownError -125 235 | #define daveEmptyResultError -126 236 | #define daveEmptyResultSetError -127 237 | #define daveResUnexpectedFunc -128 238 | #define daveResUnknownDataUnitSize -129 239 | #define daveResNoBuffer -130 240 | #define daveNotAvailableInS5 -131 241 | #define daveResInvalidLength -132 242 | #define daveResInvalidParam -133 243 | #define daveResNotYetImplemented -134 244 | 245 | #define daveResShortPacket -1024 246 | #define daveResTimeout -1025 247 | 248 | /* 249 | Error code to message string conversion: 250 | Call this function to get an explanation for error codes returned by other functions. 251 | */ 252 | EXPORTSPEC char * DECL2 daveStrerror(int code); // result is char because this is usual for strings 253 | 254 | /* 255 | Copy an internal String into an external string buffer. This is needed to interface 256 | with Visual Basic. Maybe it is helpful elsewhere, too. 257 | */ 258 | EXPORTSPEC void DECL2 daveStringCopy(char * intString, char * extString); // args are char because this is usual for strings 259 | 260 | 261 | /* 262 | Max number of bytes in a single message. 263 | An upper limit for MPI over serial is: 264 | 8 transport header 265 | +2*240 max PDU len *2 if every character were a DLE 266 | +3 DLE,ETX and BCC 267 | = 491 268 | 269 | Later I saw some programs offering up to 960 bytes in PDU size negotiation 270 | 271 | Max number of bytes in a single message. 272 | An upper limit for MPI over serial is: 273 | 8 transport header 274 | +2*960 max PDU len *2 if every character were a DLE 275 | +3 DLE,ETX and BCC 276 | = 1931 277 | 278 | For now, we take the rounded max of all this to determine our buffer size. This is ok 279 | for PC systems, where one k less or more doesn't matter. 280 | */ 281 | #define daveMaxRawLen 2048 282 | /* 283 | Some definitions for debugging: 284 | */ 285 | #define daveDebugRawRead 0x01 /* Show the single bytes received */ 286 | #define daveDebugSpecialChars 0x02 /* Show when special chars are read */ 287 | #define daveDebugRawWrite 0x04 /* Show the single bytes written */ 288 | #define daveDebugListReachables 0x08 /* Show the steps when determine devices in MPI net */ 289 | #define daveDebugInitAdapter 0x10 /* Show the steps when Initilizing the MPI adapter */ 290 | #define daveDebugConnect 0x20 /* Show the steps when connecting a PLC */ 291 | #define daveDebugPacket 0x40 292 | #define daveDebugByte 0x80 293 | #define daveDebugCompare 0x100 294 | #define daveDebugExchange 0x200 295 | #define daveDebugPDU 0x400 /* debug PDU handling */ 296 | #define daveDebugUpload 0x800 /* debug PDU loading program blocks from PLC */ 297 | #define daveDebugMPI 0x1000 298 | #define daveDebugPrintErrors 0x2000 /* Print error messages */ 299 | #define daveDebugPassive 0x4000 300 | 301 | #define daveDebugErrorReporting 0x8000 302 | #define daveDebugOpen 0x10000 /* print messages in openSocket and setPort */ 303 | 304 | #define daveDebugAll 0x1ffff 305 | /* 306 | IBH-NetLink packet types: 307 | */ 308 | #define _davePtEmpty -2 309 | #define _davePtMPIAck -3 310 | #define _davePtUnknownMPIFunc -4 311 | #define _davePtUnknownPDUFunc -5 312 | #define _davePtReadResponse 1 313 | #define _davePtWriteResponse 2 314 | 315 | /* 316 | set and read debug level: 317 | */ 318 | EXPORTSPEC void DECL2 daveSetDebug(int nDebug); 319 | EXPORTSPEC int DECL2 daveGetDebug(void); 320 | /* 321 | Some data types: 322 | */ 323 | #define uc unsigned char 324 | #define us unsigned short 325 | #define u32 unsigned int 326 | 327 | /* 328 | This is a wrapper for the serial or ethernet interface. This is here to make porting easier. 329 | */ 330 | 331 | typedef struct _daveConnection daveConnection; 332 | typedef struct _daveInterface daveInterface; 333 | 334 | /* 335 | Helper struct to manage PDUs. This is NOT the part of the packet I would call PDU, but 336 | a set of pointers that ease access to the "private parts" of a PDU. 337 | */ 338 | typedef struct { 339 | uc * header; /* pointer to start of PDU (PDU header) */ 340 | uc * param; /* pointer to start of parameters inside PDU */ 341 | uc * data; /* pointer to start of data inside PDU */ 342 | uc * udata; /* pointer to start of data inside PDU */ 343 | int hlen; /* header length */ 344 | int plen; /* parameter length */ 345 | int dlen; /* data length */ 346 | int udlen; /* user or result data length */ 347 | } PDU; 348 | 349 | /* 350 | Definitions of prototypes for the protocol specific functions. The library "switches" 351 | protocol by setting pointers to the protol specific implementations. 352 | */ 353 | typedef int (DECL2 * _initAdapterFunc) (daveInterface * ); 354 | typedef int (DECL2 * _connectPLCFunc) (daveConnection *); 355 | typedef int (DECL2 * _disconnectPLCFunc) (daveConnection *); 356 | typedef int (DECL2 * _disconnectAdapterFunc) (daveInterface * ); 357 | typedef int (DECL2 * _exchangeFunc) (daveConnection *, PDU *); 358 | typedef int (DECL2 * _sendMessageFunc) (daveConnection *, PDU *); 359 | typedef int (DECL2 * _getResponseFunc) (daveConnection *); 360 | typedef int (DECL2 * _listReachablePartnersFunc) (daveInterface * di, char * buf); // changed to unsigned char because it is a copy of an uc buffer 361 | 362 | /* 363 | Definitions of prototypes for i/O functions. 364 | */ 365 | typedef int (DECL2 * _writeFunc) (daveInterface *, char *, int); // changed to char because char is what system read/write expects 366 | typedef int (DECL2 * _readFunc) (daveInterface *, char *, int); 367 | 368 | /* 369 | This groups an interface together with some information about it's properties 370 | in the library's context. 371 | */ 372 | struct _daveInterface { 373 | tmotype timeout; /* Timeout in microseconds used in transort. */ 374 | _daveOSserialType fd; /* some handle for the serial interface */ 375 | int localMPI; /* the adapter's MPI address */ 376 | 377 | int users; /* a counter used when multiple PLCs are accessed via */ 378 | /* the same serial interface and adapter. */ 379 | char * name; /* just a name that can be used in programs dealing with multiple */ 380 | /* daveInterfaces */ 381 | int protocol; /* The kind of transport protocol used on this interface. */ 382 | int speed; /* The MPI or Profibus speed */ 383 | int ackPos; /* position of some packet number that has to be repeated in ackknowledges */ 384 | int nextConnection; 385 | _initAdapterFunc initAdapter; /* pointers to the protocol */ 386 | _connectPLCFunc connectPLC; /* specific implementations */ 387 | _disconnectPLCFunc disconnectPLC; /* of these functions */ 388 | _disconnectAdapterFunc disconnectAdapter; 389 | _exchangeFunc exchange; 390 | _sendMessageFunc sendMessage; 391 | _getResponseFunc getResponse; 392 | _listReachablePartnersFunc listReachablePartners; 393 | char realName[20]; 394 | _readFunc ifread; 395 | _writeFunc ifwrite; 396 | int seqNumber; 397 | }; 398 | 399 | EXPORTSPEC daveInterface * DECL2 daveNewInterface(_daveOSserialType nfd, char * nname, int localMPI, int protocol, int speed); 400 | EXPORTSPEC daveInterface * DECL2 davePascalNewInterface(_daveOSserialType* nfd, char * nname, int localMPI, int protocol, int speed); 401 | /* 402 | This is the packet header used by IBH ethernet NetLink. 403 | */ 404 | typedef struct { 405 | uc ch1; // logical connection or channel ? 406 | uc ch2; // logical connection or channel ? 407 | uc len; // number of bytes counted from the ninth one. 408 | uc packetNumber; // a counter, response packets refer to request packets 409 | us sFlags; // my guess 410 | us rFlags; // my interpretation 411 | } IBHpacket; 412 | 413 | /* 414 | Header for MPI packets on IBH-NetLink: 415 | */ 416 | 417 | typedef struct { 418 | uc src_conn; 419 | uc dst_conn; 420 | uc MPI; 421 | uc localMPI; 422 | uc len; 423 | uc func; 424 | uc packetNumber; 425 | } MPIheader; 426 | 427 | typedef struct { 428 | uc src_conn; 429 | uc dst_conn; 430 | uc MPI; 431 | uc xxx1; 432 | uc xxx2; 433 | uc xx22; 434 | uc len; 435 | uc func; 436 | uc packetNumber; 437 | } MPIheader2; 438 | 439 | typedef struct _daveS5AreaInfo { 440 | int area; 441 | int DBnumber; 442 | int address; 443 | int len; 444 | struct _daveS5AreaInfo * next; 445 | } daveS5AreaInfo; 446 | 447 | typedef struct _daveS5cache { 448 | int PAE; // start of inputs 449 | int PAA; // start of outputs 450 | int flags; // start of flag (marker) memory 451 | int timers; // start of timer memory 452 | int counters;// start of counter memory 453 | int systemData;// start of system data 454 | daveS5AreaInfo * first; 455 | } daveS5cache; 456 | 457 | /* 458 | This holds data for a PLC connection; 459 | */ 460 | 461 | struct _daveConnection { 462 | int AnswLen; /* length of last message */ 463 | uc * resultPointer; /* used to retrieve single values from the result byte array */ 464 | int maxPDUlength; 465 | int MPIAdr; /* The PLC's address */ 466 | daveInterface * iface; /* pointer to used interface */ 467 | int needAckNumber; /* message number we need ackknowledge for */ 468 | int PDUnumber; /* current PDU number */ 469 | int ibhSrcConn; 470 | int ibhDstConn; 471 | uc msgIn[daveMaxRawLen]; 472 | uc msgOut[daveMaxRawLen]; 473 | uc * _resultPointer; 474 | int PDUstartO; /* position of PDU in outgoing messages. This is different for different transport methodes. */ 475 | int PDUstartI; /* position of PDU in incoming messages. This is different for different transport methodes. */ 476 | int rack; /* rack number for ISO over TCP */ 477 | int slot; /* slot number for ISO over TCP */ 478 | int connectionNumber; 479 | int connectionNumber2; 480 | uc messageNumber; /* current MPI message number */ 481 | uc packetNumber; /* packetNumber in transport layer */ 482 | void * hook; /* used in CPU/CP simulation: pointer to the rest we have to send if message doesn't fit in a single packet */ 483 | daveS5cache * cache; /* used in AS511: We cache addresses of memory areas and datablocks here */ 484 | }; 485 | 486 | /* 487 | Setup a new connection structure using an initialized 488 | daveInterface and PLC's MPI address. 489 | */ 490 | EXPORTSPEC 491 | daveConnection * DECL2 daveNewConnection(daveInterface * di, int MPI,int rack, int slot); 492 | 493 | 494 | typedef struct { 495 | uc type[2]; 496 | unsigned short count; 497 | } daveBlockTypeEntry; 498 | 499 | typedef struct { 500 | unsigned short number; 501 | uc type[2]; 502 | } daveBlockEntry; 503 | 504 | typedef struct { 505 | uc type[2]; 506 | uc x1[2]; /* 00 4A */ 507 | uc w1[2]; /* some word var? */ 508 | char pp[2]; /* allways 'pp' */ 509 | uc x2[4]; /* 00 4A */ 510 | unsigned short number; /* the block's number */ 511 | uc x3[26]; /* ? */ 512 | unsigned short length; /* the block's length */ 513 | uc x4[16]; 514 | uc name[8]; 515 | uc x5[12]; 516 | } daveBlockInfo; 517 | /** 518 | PDU handling: 519 | PDU is the central structure present in S7 communication. 520 | It is composed of a 10 or 12 byte header,a parameter block and a data block. 521 | When reading or writing values, the data field is itself composed of a data 522 | header followed by payload data 523 | **/ 524 | typedef struct { 525 | uc P; /* allways 0x32 */ 526 | uc type; /* Header type, one of 1,2,3 or 7. type 2 and 3 headers are two bytes longer. */ 527 | uc a,b; /* currently unknown. Maybe it can be used for long numbers? */ 528 | us number; /* A number. This can be used to make sure a received answer */ 529 | /* corresponds to the request with the same number. */ 530 | us plen; /* length of parameters which follow this header */ 531 | us dlen; /* length of data which follow the parameters */ 532 | uc result[2]; /* only present in type 2 and 3 headers. This contains error information. */ 533 | } PDUHeader; 534 | /* 535 | set up the header. Needs valid header pointer in the struct p points to. 536 | */ 537 | EXPORTSPEC void DECL2 _daveInitPDUheader(PDU * p, int type); 538 | /* 539 | add parameters after header, adjust pointer to data. 540 | needs valid header 541 | */ 542 | EXPORTSPEC void DECL2 _daveAddParam(PDU * p,uc * param,us len); 543 | /* 544 | add data after parameters, set dlen 545 | needs valid header,and valid parameters. 546 | */ 547 | EXPORTSPEC void DECL2 _daveAddData(PDU * p,void * data,int len); 548 | /* 549 | add values after value header in data, adjust dlen and data count. 550 | needs valid header,parameters,data,dlen 551 | */ 552 | EXPORTSPEC void DECL2 _daveAddValue(PDU * p,void * data,int len); 553 | /* 554 | add data in user data. Add a user data header, if not yet present. 555 | */ 556 | EXPORTSPEC void DECL2 _daveAddUserData(PDU * p, uc * da, int len); 557 | /* 558 | set up pointers to the fields of a received message 559 | */ 560 | EXPORTSPEC int DECL2 _daveSetupReceivedPDU(daveConnection * dc,PDU * p); 561 | /* 562 | Get the eror code from a PDU, if one. 563 | */ 564 | EXPORTSPEC int DECL2 daveGetPDUerror(PDU * p); 565 | /* 566 | send PDU to PLC and retrieve the answer 567 | */ 568 | EXPORTSPEC int DECL2 _daveExchange(daveConnection * dc,PDU *p); 569 | /* 570 | retrieve the answer 571 | */ 572 | EXPORTSPEC int DECL2 daveGetResponse(daveConnection * dc); 573 | /* 574 | send PDU to PLC 575 | */ 576 | EXPORTSPEC int DECL2 daveSendMessage(daveConnection * dc, PDU * p); 577 | 578 | /****** 579 | 580 | Utilities: 581 | 582 | ****/ 583 | /* 584 | Hex dump PDU: 585 | */ 586 | EXPORTSPEC void DECL2 _daveDumpPDU(PDU * p); 587 | 588 | /* 589 | This is an extended memory compare routine. It can handle don't care and stop flags 590 | in the sample data. A stop flag lets it return success, if there were no mismatches 591 | up to this point. 592 | */ 593 | EXPORTSPEC int DECL2 _daveMemcmp(us * a, uc *b, size_t len); 594 | 595 | /* 596 | Hex dump. Write the name followed by len bytes written in hex and a newline: 597 | */ 598 | //EXPORTSPEC void DECL2 _daveDump(char * name, uc *b, int len); 599 | EXPORTSPEC void DECL2 _daveDump(char * name, void *b, int len); 600 | 601 | /* 602 | names for PLC objects: 603 | */ 604 | EXPORTSPEC char * DECL2 daveBlockName(uc bn); // char or uc,to decide 605 | EXPORTSPEC char * DECL2 daveAreaName(uc n); // to decide 606 | 607 | /* 608 | swap functions. These swap function do a swao on little endian machines only: 609 | */ 610 | EXPORTSPEC short DECL2 daveSwapIed_16(short ff); 611 | EXPORTSPEC int DECL2 daveSwapIed_32(int ff); 612 | 613 | /** 614 | Data conversion convenience functions. The older set has been removed. 615 | Newer conversion routines. As the terms WORD, INT, INTEGER etc have different meanings 616 | for users of different programming languages and compilers, I choose to provide a new 617 | set of conversion routines named according to the bit length of the value used. The 'U' 618 | or 'S' stands for unsigned or signed. 619 | **/ 620 | /* 621 | Get a value from the position b points to. B is typically a pointer to a buffer that has 622 | been filled with daveReadBytes: 623 | */ 624 | EXPORTSPEC float DECL2 daveGetFloatAt(daveConnection * dc, int pos); 625 | EXPORTSPEC float DECL2 daveGetKGAt(daveConnection * dc, int pos); 626 | 627 | 628 | EXPORTSPEC float DECL2 toPLCfloat(float ff); 629 | EXPORTSPEC int DECL2 daveToPLCfloat(float ff); 630 | EXPORTSPEC int DECL2 daveToKG(float ff); 631 | 632 | 633 | EXPORTSPEC int DECL2 daveGetS8from(uc *b); 634 | EXPORTSPEC int DECL2 daveGetU8from(uc *b); 635 | EXPORTSPEC int DECL2 daveGetS16from(uc *b); 636 | EXPORTSPEC int DECL2 daveGetU16from(uc *b); 637 | EXPORTSPEC int DECL2 daveGetS32from(uc *b); 638 | EXPORTSPEC unsigned int DECL2 daveGetU32from(uc *b); 639 | EXPORTSPEC float DECL2 daveGetFloatfrom(uc *b); 640 | EXPORTSPEC float DECL2 daveGetKGfrom(uc *b); 641 | /* 642 | Get a value from the current position in the last result read on the connection dc. 643 | This will increment an internal pointer, so the next value is read from the position 644 | following this value. 645 | */ 646 | 647 | EXPORTSPEC int DECL2 daveGetS8(daveConnection * dc); 648 | EXPORTSPEC int DECL2 daveGetU8(daveConnection * dc); 649 | EXPORTSPEC int DECL2 daveGetS16(daveConnection * dc); 650 | EXPORTSPEC int DECL2 daveGetU16(daveConnection * dc); 651 | EXPORTSPEC int DECL2 daveGetS32(daveConnection * dc); 652 | EXPORTSPEC unsigned int DECL2 daveGetU32(daveConnection * dc); 653 | EXPORTSPEC float DECL2 daveGetFloat(daveConnection * dc); 654 | EXPORTSPEC float DECL2 daveGetKG(daveConnection * dc); 655 | /* 656 | Get a value from a given position in the last result read on the connection dc. 657 | */ 658 | EXPORTSPEC int DECL2 daveGetS8At(daveConnection * dc, int pos); 659 | EXPORTSPEC int DECL2 daveGetU8At(daveConnection * dc, int pos); 660 | EXPORTSPEC int DECL2 daveGetS16At(daveConnection * dc, int pos); 661 | EXPORTSPEC int DECL2 daveGetU16At(daveConnection * dc, int pos); 662 | EXPORTSPEC int DECL2 daveGetS32At(daveConnection * dc, int pos); 663 | EXPORTSPEC unsigned int DECL2 daveGetU32At(daveConnection * dc, int pos); 664 | /* 665 | put one byte into buffer b: 666 | */ 667 | EXPORTSPEC uc * DECL2 davePut8(uc *b,int v); 668 | EXPORTSPEC uc * DECL2 davePut16(uc *b,int v); 669 | EXPORTSPEC uc * DECL2 davePut32(uc *b,int v); 670 | EXPORTSPEC uc * DECL2 davePutFloat(uc *b,float v); 671 | EXPORTSPEC uc * DECL2 davePutKG(uc *b,float v); 672 | EXPORTSPEC void DECL2 davePut8At(uc *b, int pos, int v); 673 | EXPORTSPEC void DECL2 davePut16At(uc *b, int pos, int v); 674 | EXPORTSPEC void DECL2 davePut32At(uc *b, int pos, int v); 675 | EXPORTSPEC void DECL2 davePutFloatAt(uc *b,int pos, float v); 676 | EXPORTSPEC void DECL2 davePutKGAt(uc *b,int pos, float v); 677 | /** 678 | Timer and Counter conversion functions: 679 | **/ 680 | /* 681 | get time in seconds from current read position: 682 | */ 683 | EXPORTSPEC float DECL2 daveGetSeconds(daveConnection * dc); 684 | /* 685 | get time in seconds from random position: 686 | */ 687 | EXPORTSPEC float DECL2 daveGetSecondsAt(daveConnection * dc, int pos); 688 | /* 689 | get counter value from current read position: 690 | */ 691 | EXPORTSPEC int DECL2 daveGetCounterValue(daveConnection * dc); 692 | /* 693 | get counter value from random read position: 694 | */ 695 | EXPORTSPEC int DECL2 daveGetCounterValueAt(daveConnection * dc,int pos); 696 | 697 | /* 698 | Functions to load blocks from PLC: 699 | */ 700 | EXPORTSPEC void DECL2 _daveConstructUpload(PDU *p, char blockType, int blockNr); // char or uc,to decide 701 | 702 | EXPORTSPEC void DECL2 _daveConstructDoUpload(PDU * p, int uploadID); 703 | 704 | EXPORTSPEC void DECL2 _daveConstructEndUpload(PDU * p, int uploadID); 705 | /* 706 | Get the PLC's order code as ASCIIZ. Buf must provide space for 707 | 21 characters at least. 708 | */ 709 | 710 | #define daveOrderCodeSize 21 711 | EXPORTSPEC int DECL2 daveGetOrderCode(daveConnection * dc, char * buf); // char, users buffer, or to decide 712 | 713 | /* 714 | connect to a PLC. returns 0 on success. 715 | */ 716 | EXPORTSPEC int DECL2 daveConnectPLC(daveConnection * dc); 717 | 718 | /* 719 | Read len bytes from the PLC. Start determines the first byte. 720 | Area denotes whether the data comes from FLAGS, DATA BLOCKS, 721 | INPUTS or OUTPUTS, etc. 722 | DB is the number of the data block to be used. Set it to zero 723 | for other area types. 724 | Buffer is a pointer to a memory block provided by the calling 725 | program. If the pointer is not NULL, the result data will be copied thereto. 726 | Hence it must be big enough to take up the result. 727 | In any case, you can also retrieve the result data using the get macros 728 | on the connection pointer. 729 | 730 | RESTRICTION:There is no check for max. message len or automatic splitting into 731 | multiple messages. Use daveReadManyBytes() in case the data you want 732 | to read doesn't fit into a single PDU. 733 | 734 | */ 735 | EXPORTSPEC int DECL2 daveReadBytes(daveConnection * dc, int area, int DB, int start, int len, void * buffer); 736 | 737 | /* 738 | Read len bytes from the PLC. Start determines the first byte. 739 | In contrast to daveReadBytes(), this function can read blocks 740 | that are too long for a single transaction. To achieve this, 741 | the data is fetched with multiple subsequent read requests to 742 | the CPU. 743 | Area denotes whether the data comes from FLAGS, DATA BLOCKS, 744 | INPUTS or OUTPUTS, etc. 745 | DB is the number of the data block to be used. Set it to zero 746 | for other area types. 747 | Buffer is a pointer to a memory block provided by the calling 748 | program. It may not be NULL, the result data will be copied thereto. 749 | Hence it must be big enough to take up the result. 750 | You CANNOT read result bytes from the internal buffer of the 751 | daveConnection. This buffer is overwritten in each read request. 752 | */ 753 | EXPORTSPEC int DECL2 daveReadManyBytes(daveConnection * dc,int area, int DBnum, int start,int len, void * buffer); 754 | 755 | /* 756 | Write len bytes from buffer to the PLC. 757 | Start determines the first byte. 758 | Area denotes whether the data goes to FLAGS, DATA BLOCKS, 759 | INPUTS or OUTPUTS, etc. 760 | DB is the number of the data block to be used. Set it to zero 761 | for other area types. 762 | RESTRICTION: There is no check for max. message len or automatic splitting into 763 | multiple messages. Use daveReadManyBytes() in case the data you want 764 | to read doesn't fit into a single PDU. 765 | 766 | */ 767 | EXPORTSPEC int DECL2 daveWriteBytes(daveConnection * dc,int area, int DB, int start, int len, void * buffer); 768 | 769 | /* 770 | Write len bytes to the PLC. Start determines the first byte. 771 | In contrast to daveWriteBytes(), this function can write blocks 772 | that are too long for a single transaction. To achieve this, the 773 | the data is transported with multiple subsequent write requests to 774 | the CPU. 775 | Area denotes whether the data comes from FLAGS, DATA BLOCKS, 776 | INPUTS or OUTPUTS, etc. 777 | DB is the number of the data block to be used. Set it to zero 778 | for other area types. 779 | Buffer is a pointer to a memory block provided by the calling 780 | program. It may not be NULL. 781 | */ 782 | EXPORTSPEC int DECL2 daveWriteManyBytes(daveConnection * dc,int area, int DB, int start, int len, void * buffer); 783 | /* 784 | Bit manipulation: 785 | */ 786 | EXPORTSPEC int DECL2 daveReadBits(daveConnection * dc, int area, int DB, int start, int len, void * buffer); 787 | EXPORTSPEC int DECL2 daveWriteBits(daveConnection * dc,int area, int DB, int start, int len, void * buffer); 788 | EXPORTSPEC int DECL2 daveSetBit(daveConnection * dc,int area, int DB, int byteAdr, int bitAdr); 789 | EXPORTSPEC int DECL2 daveClrBit(daveConnection * dc,int area, int DB, int byteAdr, int bitAdr); 790 | 791 | /* 792 | PLC diagnostic and inventory functions: 793 | */ 794 | EXPORTSPEC int DECL2 daveBuildAndSendPDU(daveConnection * dc, PDU*p2,uc *pa,int psize, uc *ud,int usize); 795 | EXPORTSPEC int DECL2 daveReadSZL(daveConnection * dc, int ID, int index, void * buf, int buflen); 796 | EXPORTSPEC int DECL2 daveListBlocksOfType(daveConnection * dc,uc type,daveBlockEntry * buf); 797 | EXPORTSPEC int DECL2 daveListBlocks(daveConnection * dc,daveBlockTypeEntry * buf); 798 | EXPORTSPEC int DECL2 daveGetBlockInfo(daveConnection * dc, daveBlockInfo *dbi, uc type, int number); 799 | /* 800 | PLC program read functions: 801 | */ 802 | EXPORTSPEC int DECL2 initUpload(daveConnection * dc, char blockType, int blockNr, int * uploadID); // char or uc,to decide 803 | EXPORTSPEC int DECL2 doUpload(daveConnection*dc, int * more, uc**buffer, int*len, int uploadID); 804 | EXPORTSPEC int DECL2 endUpload(daveConnection*dc, int uploadID); 805 | /* 806 | PLC run/stop control functions: 807 | */ 808 | EXPORTSPEC int DECL2 daveStop(daveConnection*dc); 809 | EXPORTSPEC int DECL2 daveStart(daveConnection*dc); 810 | /* 811 | PLC special commands 812 | */ 813 | EXPORTSPEC int DECL2 daveCopyRAMtoROM(daveConnection*dc); 814 | 815 | EXPORTSPEC int DECL2 daveForce200(daveConnection * dc, int area, int start, int val); 816 | /* 817 | Multiple variable support: 818 | */ 819 | typedef struct { 820 | int error; 821 | int length; 822 | uc * bytes; 823 | } daveResult; 824 | 825 | typedef struct { 826 | int numResults; 827 | daveResult * results; 828 | } daveResultSet; 829 | 830 | 831 | /* use this to initialize a multivariable read: */ 832 | EXPORTSPEC void DECL2 davePrepareReadRequest(daveConnection * dc, PDU *p); 833 | /* Adds a new variable to a prepared request: */ 834 | EXPORTSPEC void DECL2 daveAddVarToReadRequest(PDU *p, int area, int DBnum, int start, int bytes); 835 | /* Executes the complete request. */ 836 | EXPORTSPEC int DECL2 daveExecReadRequest(daveConnection * dc, PDU *p, daveResultSet * rl); 837 | /* Lets the functions daveGet work on the n-th result: */ 838 | EXPORTSPEC int DECL2 daveUseResult(daveConnection * dc, daveResultSet * rl, int n); 839 | /* Frees the memory occupied by the result structure */ 840 | EXPORTSPEC void DECL2 daveFreeResults(daveResultSet * rl); 841 | /* Adds a new bit variable to a prepared request: */ 842 | EXPORTSPEC void DECL2 daveAddBitVarToReadRequest(PDU *p, int area, int DBnum, int start, int byteCount); 843 | 844 | /* use this to initialize a multivariable write: */ 845 | EXPORTSPEC void DECL2 davePrepareWriteRequest(daveConnection * dc, PDU *p); 846 | /* Add a preformed variable aderess to a read request: */ 847 | EXPORTSPEC void DECL2 daveAddToReadRequest(PDU *p, int area, int DBnum, int start, int byteCount, int isBit); 848 | /* Adds a new variable to a prepared request: */ 849 | EXPORTSPEC void DECL2 daveAddVarToWriteRequest(PDU *p, int area, int DBnum, int start, int bytes, void * buffer); 850 | /* Adds a new bit variable to a prepared write request: */ 851 | EXPORTSPEC void DECL2 daveAddBitVarToWriteRequest(PDU *p, int area, int DBnum, int start, int byteCount, void * buffer); 852 | EXPORTSPEC int DECL2 _daveTestResultData(PDU * p); 853 | EXPORTSPEC int DECL2 _daveTestReadResult(PDU * p); 854 | EXPORTSPEC int DECL2 _daveTestPGReadResult(PDU * p); 855 | 856 | /* Executes the complete request. */ 857 | EXPORTSPEC int DECL2 daveExecWriteRequest(daveConnection * dc, PDU *p, daveResultSet * rl); 858 | EXPORTSPEC int DECL2 _daveTestWriteResult(PDU * p); 859 | 860 | EXPORTSPEC int DECL2 daveInitAdapter(daveInterface * di); 861 | EXPORTSPEC int DECL2 daveConnectPLC(daveConnection * dc); 862 | EXPORTSPEC int DECL2 daveDisconnectPLC(daveConnection * dc); 863 | 864 | EXPORTSPEC int DECL2 daveDisconnectAdapter(daveInterface * di); 865 | EXPORTSPEC int DECL2 daveListReachablePartners(daveInterface * di, char * buf); 866 | 867 | EXPORTSPEC int DECL2 _daveReturnOkDummy(daveInterface * di); 868 | EXPORTSPEC int DECL2 _daveReturnOkDummy2(daveConnection * dc); 869 | EXPORTSPEC int DECL2 _daveListReachablePartnersDummy(daveInterface * di, char * buf); 870 | 871 | EXPORTSPEC int DECL2 _daveNegPDUlengthRequest(daveConnection * dc, PDU *p); 872 | 873 | /* MPI specific functions */ 874 | 875 | #define daveMPIReachable 0x30 876 | #define daveMPIActive 0x30 877 | #define daveMPIPassive 0x00 878 | #define daveMPIunused 0x10 879 | #define davePartnerListSize 126 880 | 881 | EXPORTSPEC int DECL2 _daveListReachablePartnersMPI(daveInterface * di, char * buf); 882 | EXPORTSPEC int DECL2 _daveInitAdapterMPI1(daveInterface * di); 883 | EXPORTSPEC int DECL2 _daveInitAdapterMPI2(daveInterface * di); 884 | EXPORTSPEC int DECL2 _daveConnectPLCMPI1(daveConnection * dc); 885 | EXPORTSPEC int DECL2 _daveConnectPLCMPI2(daveConnection * dc); 886 | EXPORTSPEC int DECL2 _daveDisconnectPLCMPI(daveConnection * dc); 887 | EXPORTSPEC int DECL2 _daveDisconnectAdapterMPI(daveInterface * di); 888 | EXPORTSPEC int DECL2 _daveExchangeMPI(daveConnection * dc,PDU * p1); 889 | 890 | EXPORTSPEC int DECL2 _daveListReachablePartnersMPI3(daveInterface * di,char * buf); 891 | EXPORTSPEC int DECL2 _daveInitAdapterMPI3(daveInterface * di); 892 | EXPORTSPEC int DECL2 _daveConnectPLCMPI3(daveConnection * dc); 893 | EXPORTSPEC int DECL2 _daveDisconnectPLCMPI3(daveConnection * dc); 894 | EXPORTSPEC int DECL2 _daveDisconnectAdapterMPI3(daveInterface * di); 895 | EXPORTSPEC int DECL2 _daveExchangeMPI3(daveConnection * dc,PDU * p1); 896 | EXPORTSPEC int DECL2 _daveIncMessageNumber(daveConnection * dc); 897 | 898 | /* ISO over TCP specific functions */ 899 | EXPORTSPEC int DECL2 _daveExchangeTCP(daveConnection * dc,PDU * p1); 900 | EXPORTSPEC int DECL2 _daveConnectPLCTCP(daveConnection * dc); 901 | /* 902 | make internal PPI functions available for experimental use: 903 | */ 904 | EXPORTSPEC int DECL2 _daveExchangePPI(daveConnection * dc,PDU * p1); 905 | EXPORTSPEC void DECL2 _daveSendLength(daveInterface * di, int len); 906 | EXPORTSPEC void DECL2 _daveSendRequestData(daveConnection * dc, int alt); 907 | EXPORTSPEC void DECL2 _daveSendIt(daveInterface * di, uc * b, int size); 908 | EXPORTSPEC int DECL2 _daveGetResponsePPI(daveConnection *dc); 909 | EXPORTSPEC int DECL2 _daveReadChars(daveInterface * di, uc *b, tmotype tmo, int max); 910 | EXPORTSPEC int DECL2 _daveReadChars2(daveInterface * di,uc *b, int max); 911 | EXPORTSPEC int DECL2 _daveConnectPLCPPI(daveConnection * dc); 912 | 913 | /* 914 | make internal MPI functions available for experimental use: 915 | */ 916 | EXPORTSPEC int DECL2 _daveReadMPI(daveInterface * di, uc *b); 917 | EXPORTSPEC void DECL2 _daveSendSingle(daveInterface * di, uc c); 918 | EXPORTSPEC int DECL2 _daveSendAck(daveConnection * dc, int nr); 919 | EXPORTSPEC int DECL2 _daveGetAck(daveConnection * dc); 920 | EXPORTSPEC int DECL2 _daveSendDialog2(daveConnection * dc, int size); 921 | EXPORTSPEC int DECL2 _daveSendWithPrefix(daveConnection * dc, uc * b, int size); 922 | EXPORTSPEC int DECL2 _daveSendWithPrefix2(daveConnection * dc, int size); 923 | EXPORTSPEC int DECL2 _daveSendWithCRC(daveInterface * di, uc *b, int size); 924 | EXPORTSPEC int DECL2 _daveReadSingle(daveInterface * di); 925 | EXPORTSPEC int DECL2 _daveReadOne(daveInterface * di, uc *b); 926 | EXPORTSPEC int DECL2 _daveReadMPI2(daveInterface * di, uc *b); 927 | EXPORTSPEC int DECL2 _daveGetResponseMPI(daveConnection *dc); 928 | EXPORTSPEC int DECL2 _daveSendMessageMPI(daveConnection * dc, PDU * p); 929 | 930 | /* 931 | make internal ISO_TCP functions available for experimental use: 932 | */ 933 | /* 934 | Read one complete packet. The bytes 3 and 4 contain length information. 935 | */ 936 | EXPORTSPEC int DECL2 _daveReadISOPacket(daveInterface * di,uc *b); 937 | EXPORTSPEC int DECL2 _daveGetResponseISO_TCP(daveConnection *dc); 938 | 939 | 940 | typedef uc * (*userReadFunc) (int , int, int, int, int *); 941 | typedef void (*userWriteFunc) (int , int, int, int, int *,uc *); 942 | extern userReadFunc readCallBack; 943 | extern userWriteFunc writeCallBack; 944 | 945 | EXPORTSPEC void DECL2 _daveConstructReadResponse(PDU * p); 946 | EXPORTSPEC void DECL2 _daveConstructWriteResponse(PDU * p); 947 | EXPORTSPEC void DECL2 _daveConstructBadReadResponse(PDU * p); 948 | EXPORTSPEC void DECL2 _daveHandleRead(PDU * p1,PDU * p2); 949 | EXPORTSPEC void DECL2 _daveHandleWrite(PDU * p1,PDU * p2); 950 | /* 951 | make internal IBH functions available for experimental use: 952 | */ 953 | EXPORTSPEC int DECL2 _daveReadIBHPacket(daveInterface * di,uc *b); 954 | EXPORTSPEC int DECL2 _daveWriteIBH(daveInterface * di, uc * buffer, int len); 955 | EXPORTSPEC int DECL2 _davePackPDU(daveConnection * dc,PDU *p); 956 | EXPORTSPEC void DECL2 _daveSendMPIAck_IBH(daveConnection*dc); 957 | EXPORTSPEC void DECL2 _daveSendIBHNetAck(daveConnection * dc); 958 | EXPORTSPEC int DECL2 __daveAnalyze(daveConnection * dc); 959 | EXPORTSPEC int DECL2 _daveExchangeIBH(daveConnection * dc, PDU * p); 960 | EXPORTSPEC int DECL2 _daveSendMessageMPI_IBH(daveConnection * dc, PDU * p); 961 | EXPORTSPEC int DECL2 _daveGetResponseMPI_IBH(daveConnection *dc); 962 | EXPORTSPEC int DECL2 _daveInitStepIBH(daveInterface * iface, uc * chal, int cl, us* resp,int rl, uc*b); 963 | 964 | EXPORTSPEC int DECL2 _daveConnectPLC_IBH(daveConnection*dc); 965 | EXPORTSPEC int DECL2 _daveDisconnectPLC_IBH(daveConnection*dc); 966 | EXPORTSPEC void DECL2 _daveSendMPIAck2(daveConnection *dc); 967 | EXPORTSPEC int DECL2 _davePackPDU_PPI(daveConnection * dc,PDU *p); 968 | EXPORTSPEC void DECL2 _daveSendIBHNetAckPPI(daveConnection * dc); 969 | EXPORTSPEC int DECL2 _daveListReachablePartnersMPI_IBH(daveInterface *di, char * buf); 970 | EXPORTSPEC int DECL2 __daveAnalyzePPI(daveConnection * dc, uc sa); 971 | EXPORTSPEC int DECL2 _daveExchangePPI_IBH(daveConnection * dc, PDU * p); 972 | EXPORTSPEC int DECL2 _daveGetResponsePPI_IBH(daveConnection *dc); 973 | 974 | /** 975 | C# interoperability: 976 | **/ 977 | EXPORTSPEC void DECL2 daveSetTimeout(daveInterface * di, int tmo); 978 | EXPORTSPEC int DECL2 daveGetTimeout(daveInterface * di); 979 | EXPORTSPEC char * DECL2 daveGetName(daveInterface * di); 980 | 981 | EXPORTSPEC int DECL2 daveGetMPIAdr(daveConnection * dc); 982 | EXPORTSPEC int DECL2 daveGetAnswLen(daveConnection * dc); 983 | EXPORTSPEC int DECL2 daveGetMaxPDULen(daveConnection * dc); 984 | EXPORTSPEC daveResultSet * DECL2 daveNewResultSet(); 985 | EXPORTSPEC void DECL2 daveFree(void * dc); 986 | EXPORTSPEC PDU * DECL2 daveNewPDU(); 987 | EXPORTSPEC int DECL2 daveGetErrorOfResult(daveResultSet *,int number); 988 | 989 | /* 990 | Special function do disconnect arbitrary connections on IBH-Link: 991 | */ 992 | EXPORTSPEC int DECL2 daveForceDisconnectIBH(daveInterface * di, int src, int dest, int mpi); 993 | /* 994 | Special function do reset an IBH-Link: 995 | */ 996 | EXPORTSPEC int DECL2 daveResetIBH(daveInterface * di); 997 | /* 998 | Program Block from PLC: 999 | */ 1000 | EXPORTSPEC int DECL2 daveGetProgramBlock(daveConnection * dc, int blockType, int number, char* buffer, int * length); 1001 | /** 1002 | PLC realtime clock handling: 1003 | */ 1004 | /* 1005 | read out clock: 1006 | */ 1007 | EXPORTSPEC int DECL2 daveReadPLCTime(daveConnection * dc); 1008 | /* 1009 | set clock to a value given by user: 1010 | */ 1011 | EXPORTSPEC int DECL2 daveSetPLCTime(daveConnection * dc,uc * ts); 1012 | /* 1013 | set clock to PC system clock: 1014 | */ 1015 | EXPORTSPEC int DECL2 daveSetPLCTimeToSystime(daveConnection * dc); 1016 | /* 1017 | BCD conversions: 1018 | */ 1019 | EXPORTSPEC uc DECL2 daveToBCD(uc i); 1020 | EXPORTSPEC uc DECL2 daveFromBCD(uc i); 1021 | /* 1022 | S5: 1023 | */ 1024 | EXPORTSPEC int DECL2 _daveFakeExchangeAS511(daveConnection * dc, PDU * p); 1025 | EXPORTSPEC int DECL2 _daveExchangeAS511(daveConnection * dc, uc * b,int len,int maxLen, int trN); 1026 | EXPORTSPEC int DECL2 _daveSendMessageAS511(daveConnection * dc, PDU * p); 1027 | EXPORTSPEC int DECL2 _daveConnectPLCAS511(daveConnection * dc); 1028 | EXPORTSPEC int DECL2 _daveDisconnectPLCAS511(daveConnection * dc); 1029 | EXPORTSPEC int DECL2 _daveIsS5BlockArea(uc area); 1030 | EXPORTSPEC int DECL2 _daveReadS5BlockAddress(daveConnection * dc, uc area, uc BlockN, daveS5AreaInfo * ai); 1031 | EXPORTSPEC int DECL2 _daveReadS5ImageAddress(daveConnection * dc, uc area, daveS5AreaInfo * ai); 1032 | EXPORTSPEC int DECL2 _daveIsS5ImageArea(uc area); 1033 | EXPORTSPEC int DECL2 _daveIsS5DBBlockArea(uc area); 1034 | EXPORTSPEC int DECL2 daveReadS5Bytes(daveConnection * dc, uc area, uc BlockN, int offset, int count); 1035 | EXPORTSPEC int DECL2 daveWriteS5Bytes(daveConnection * dc, uc area, uc BlockN, int offset, int count, void * buf); 1036 | EXPORTSPEC int DECL2 daveStopS5(daveConnection * dc); 1037 | EXPORTSPEC int DECL2 daveStartS5(daveConnection * dc); 1038 | EXPORTSPEC int DECL2 daveGetS5ProgramBlock(daveConnection * dc, int blockType, int number, char* buffer, int * length); 1039 | 1040 | /* 1041 | MPI version 3: 1042 | */ 1043 | EXPORTSPEC int DECL2 _daveSendWithPrefix31(daveConnection * dc, uc *b, int size); 1044 | EXPORTSPEC int DECL2 _daveGetResponseMPI3(daveConnection *dc); 1045 | EXPORTSPEC int DECL2 _daveSendMessageMPI3(daveConnection * dc, PDU * p); 1046 | 1047 | /* 1048 | using S7 dlls for transporrt: 1049 | */ 1050 | 1051 | #pragma pack(1) 1052 | 1053 | #ifndef BCCWIN //We can use this under windows only, but avoid error messages 1054 | #define HANDLE int 1055 | #endif 1056 | 1057 | /* 1058 | Prototypes for the functions in S7onlinx.dll: 1059 | They are guessed. 1060 | */ 1061 | typedef int (DECL2 * _openFunc) (const uc *); 1062 | typedef int (DECL2 * _closeFunc) (int); 1063 | typedef int (DECL2 * _sendFunc) (int, us, uc *); 1064 | typedef int (DECL2 * _receiveFunc) (int, us, int *, us, uc *); 1065 | //typedef int (DECL2 * _SetHWndMsgFunc) (int, int, ULONG); 1066 | //typedef int (DECL2 * _SetHWndFunc) (int, HANDLE); 1067 | typedef int (DECL2 * _get_errnoFunc) (void); 1068 | 1069 | /* 1070 | And pointers to the functions. We load them using GetProcAddress() on their names because: 1071 | 1. We have no .lib file for s7onlinx. 1072 | 2. We don't want to link with a particular version. 1073 | 3. Libnodave shall remain useable without Siemens .dlls. So it shall not try to access them 1074 | unless the user chooses the daveProtoS7online transport. 1075 | */ 1076 | extern _openFunc SCP_open; 1077 | extern _closeFunc SCP_close; 1078 | extern _sendFunc SCP_send; 1079 | extern _receiveFunc SCP_receive; 1080 | //_SetHWndMsgFunc SetSinecHWndMsg; 1081 | //_SetHWndFunc SetSinecHWnd; 1082 | extern _get_errnoFunc SCP_get_errno; 1083 | /* 1084 | A block of data exchanged between S7onlinx.dll and a program using it. Most fields seem to 1085 | be allways 0. Meaningful names are guessed. 1086 | */ 1087 | 1088 | typedef struct { 1089 | us unknown [2]; 1090 | uc headerlength; 1091 | us number; 1092 | uc allways2; 1093 | uc field5; 1094 | uc unknown3 [3]; 1095 | uc field6; 1096 | uc field7; 1097 | us field8; 1098 | us validDataLength; 1099 | uc unknown11; 1100 | us payloadLength; 1101 | us payloadStart; 1102 | uc unknown2[12]; 1103 | uc field10; 1104 | us id3; 1105 | short functionCode; 1106 | uc unknown4[2]; 1107 | uc field13; 1108 | uc field11; 1109 | uc field12; 1110 | uc unknown6[35]; 1111 | uc payload[520]; 1112 | } S7OexchangeBlock; 1113 | 1114 | EXPORTSPEC int DECL2 _daveCP_send(int fd, int len, uc * reqBlock); 1115 | EXPORTSPEC int DECL2 _daveSCP_send(int fd, uc * reqBlock); 1116 | EXPORTSPEC int DECL2 _daveConnectPLCS7online (daveConnection * dc); 1117 | EXPORTSPEC int DECL2 _daveSendMessageS7online(daveConnection * dc, PDU *p); 1118 | EXPORTSPEC int DECL2 _daveGetResponseS7online(daveConnection * dc); 1119 | EXPORTSPEC int DECL2 _daveExchangeS7online(daveConnection * dc, PDU * p); 1120 | EXPORTSPEC int DECL2 _daveListReachablePartnersS7online (daveInterface * di, char * buf); 1121 | EXPORTSPEC int DECL2 _daveDisconnectAdapterS7online(daveInterface * di); 1122 | 1123 | EXPORTSPEC int DECL2 stdwrite(daveInterface * di, char * buffer, int length); 1124 | EXPORTSPEC int DECL2 stdread(daveInterface * di, char * buffer, int length); 1125 | 1126 | EXPORTSPEC int DECL2 _daveInitAdapterNLpro(daveInterface * di); 1127 | EXPORTSPEC int DECL2 _daveInitStepNLpro(daveInterface * iface, int nr, uc* fix, int len, char*caller, uc * buffer); 1128 | EXPORTSPEC int DECL2 _daveConnectPLCNLpro (daveConnection * dc); 1129 | EXPORTSPEC int DECL2 _daveSendMessageNLpro(daveConnection *dc, PDU *p); 1130 | EXPORTSPEC int DECL2 _daveGetResponseNLpro(daveConnection *dc); 1131 | EXPORTSPEC int DECL2 _daveExchangeNLpro(daveConnection * dc, PDU * p); 1132 | EXPORTSPEC int DECL2 _daveSendDialogNLpro(daveConnection * dc, int size); 1133 | EXPORTSPEC int DECL2 _daveSendWithPrefixNLpro(daveConnection * dc, uc * b,int size); 1134 | EXPORTSPEC int DECL2 _daveSendWithPrefix2NLpro(daveConnection * dc, int size); 1135 | EXPORTSPEC int DECL2 _daveDisconnectPLCNLpro(daveConnection * dc); 1136 | EXPORTSPEC int DECL2 _daveDisconnectAdapterNLpro(daveInterface * di); 1137 | EXPORTSPEC int DECL2 _daveListReachablePartnersNLpro(daveInterface * di, char * buf); 1138 | 1139 | 1140 | #endif /* _nodave */ 1141 | 1142 | #ifdef __cplusplus 1143 | //#ifdef CPLUSPLUS 1144 | } 1145 | #endif 1146 | 1147 | 1148 | /* 1149 | Changes: 1150 | 07/19/04 added the definition of daveExchange(). 1151 | 09/09/04 applied patch for variable Profibus speed from Andrew Rostovtsew. 1152 | 09/09/04 applied patch from Bryan D. Payne to make this compile under Cygwin and/or newer gcc. 1153 | 12/09/04 added daveReadBits(), daveWriteBits() 1154 | 12/09/04 added some more comments. 1155 | 12/09/04 changed declaration of _daveMemcmp to use typed pointers. 1156 | 01/15/04 generic getResponse, more internal functions, use a single dummy to replace 1157 | initAdapterDummy, 1158 | 01/26/05 replaced _daveConstructReadRequest by the sequence prepareReadRequest, addVarToReadRequest 1159 | 01/26/05 added multiple write 1160 | 02/02/05 added readIBHpacket 1161 | 02/06/05 replaced _daveConstructBitWriteRequest by the sequence prepareWriteRequest, addBitVarToWriteRequest 1162 | 02/08/05 removed inline functions. 1163 | 03/23/05 added _daveGetResponsePPI_IBH(). 1164 | 03/24/05 added function codes for download. 1165 | 03/28/05 added some comments. 1166 | 04/05/05 reworked error reporting. 1167 | 04/06/05 renamed swap functions. When I began libnodave on little endian i386 and Linux, I used 1168 | used Linux bswap functions. Then users (and later me) tried other systems without 1169 | a bswap. I also cannot use inline functions in Pascal. So I made my own bswaps. Then 1170 | I, made the core of my own swaps dependent of LITTLEENDIAN conditional to support also 1171 | bigendien systems. Now I want to rename them from bswap to something else to avoid 1172 | confusion for LINUX/UNIX users. The new names are swapIed_16 and swapIed_32. This 1173 | shall say swap "if endianness differs". While I could have used similar functions 1174 | from the network API (htons etc.) on Unix and Win32, they may not be present on 1175 | e.g. microcontrollers. 1176 | I highly recommend to use these functions even when writing software for big endian 1177 | systems, where they effectively do nothing, as it will make your software portable. 1178 | 04/08/05 removed deprecated conversion functions. 1179 | 04/09/05 removed daveDebug. Use setDebug and getDebug instead. Some programming environments 1180 | do not allow access to global variables in a shared library. 1181 | 04/09/05 removed CYGWIN defines. As there were no more differences against LINUX, it should 1182 | work with LINUX defines. 1183 | 04/09/05 reordered fields in daveInterface to put fields used in normal test programs at the 1184 | beginning. This allows to make a simplified version in nodavesimple as short as 1185 | possible. 1186 | 05/09/05 renamed more functions to daveXXX. 1187 | 05/11/05 added some functions for the convenience of usage with .net or mono. The goal is 1188 | that the application doesn't have to use members of data structures defined herein 1189 | directly. This avoids "unsafe" pointer expressions in .net/MONO. It should also ease 1190 | porting to VB or other languages for which it could be difficult to define byte by 1191 | byte equivalents of these structures. 1192 | 07/31/05 added message string copying for Visual Basic. 1193 | 08/28/05 added some functions to read and set PLC realtime clock. 1194 | 09/02/05 added the pointer "hook" to daveConnection. This can be used by applications to pass 1195 | data between function calls using the dc. 1196 | 09/11/05 added read/write functions for long blocks of data. 1197 | 09/17/05 incorporation of S5 functions 1198 | 09/18/05 implemented conversions from and to S5 KG format (old, propeiatary floating point format). 1199 | */ 1200 | -------------------------------------------------------------------------------- /src/libnodave/nodavesimple.h: -------------------------------------------------------------------------------- 1 | /* 2 | Part of Libnodave, a free communication libray for Siemens S7 200/300/400 via 3 | the MPI adapter 6ES7 972-0CA22-0XAC 4 | or MPI adapter 6ES7 972-0CA23-0XAC 5 | or TS adapter 6ES7 972-0CA33-0XAC 6 | or MPI adapter 6ES7 972-0CA11-0XAC, 7 | IBH/MHJ-NetLink or CPs 243, 343 and 443 8 | or VIPA Speed7 with builtin ethernet support. 9 | 10 | (C) Thomas Hergenhahn (thomas.hergenhahn@web.de) 2002..2005 11 | 12 | Libnodave is free software; you can redistribute it and/or modify 13 | it under the terms of the GNU Library General Public License as published by 14 | the Free Software Foundation; either version 2, or (at your option) 15 | any later version. 16 | 17 | Libnodave is distributed in the hope that it will be useful, 18 | but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | GNU General Public License for more details. 21 | 22 | You should have received a copy of the GNU Library General Public License 23 | along with Libnodave; see the file COPYING. If not, write to 24 | the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 25 | */ 26 | /* 27 | Do NOT use this include file in C programs. It is just here for people who want 28 | to interface Libnodave with other programming languages, so they see that they 29 | do not neccessarily need to implement all the internal structures. 30 | 31 | So if you plan to interface with other languages, this file shall show you 32 | show the minimum of structures and funtions you'll need to make known to your compiler. 33 | */ 34 | 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | #ifndef __nodave 40 | #define __nodave 41 | 42 | #ifdef LINUX 43 | #define DECL2 44 | #define EXPORTSPEC 45 | typedef struct { 46 | int rfd; 47 | int wfd; 48 | } _daveOSserialType; 49 | #include 50 | #else 51 | #ifdef BCCWIN 52 | #define WIN32_LEAN_AND_MEAN 53 | #include 54 | #include 55 | #include 56 | #define DECL2 __stdcall 57 | //#define DECL2 cdecl 58 | #ifdef DOEXPORT 59 | #define EXPORTSPEC __declspec (dllexport) 60 | #else 61 | #define EXPORTSPEC __declspec (dllimport) 62 | #endif 63 | typedef struct { 64 | HANDLE rfd; 65 | HANDLE wfd; 66 | } _daveOSserialType; 67 | #else 68 | #error Fill in what you need for your OS or API. 69 | #endif /* BCCWIN */ 70 | #endif /* LINUX */ 71 | 72 | /* 73 | Protocol types to be used with newInterface: 74 | */ 75 | #define daveProtoMPI 0 /* MPI for S7 300/400 */ 76 | #define daveProtoMPI2 1 /* MPI for S7 300/400, "Andrew's version" */ 77 | #define daveProtoMPI3 2 /* MPI for S7 300/400, Step 7 Version, not well tested */ 78 | #define daveProtoMPI4 3 /* MPI for S7 300/400, "Andrew's version" with extra STX */ 79 | #define daveProtoPPI 10 /* PPI for S7 200 */ 80 | 81 | #define daveProtoAS511 20 /* S5 programming port protocol */ 82 | 83 | #define daveProtoS7online 50 /* use s7onlinx.dll for transport */ 84 | 85 | #define daveProtoISOTCP 122 /* ISO over TCP */ 86 | #define daveProtoISOTCP243 123 /* ISO over TCP with CP243 */ 87 | 88 | #define daveProtoNLpro 230 /* MPI with NetLink Pro MPI to ethernet gateway */ 89 | 90 | #define daveProtoMPI_IBH 223 /* MPI with IBH NetLink MPI to ethernet gateway */ 91 | #define daveProtoPPI_IBH 224 /* PPI with IBH NetLink PPI to ethernet gateway */ 92 | 93 | #define daveProtoUserTransport 255 /* Libnodave will pass the PDUs of S7 Communication to user */ 94 | /* defined call back functions. */ 95 | 96 | /* 97 | * ProfiBus speed constants: 98 | */ 99 | #define daveSpeed9k 0 100 | #define daveSpeed19k 1 101 | #define daveSpeed187k 2 102 | #define daveSpeed500k 3 103 | #define daveSpeed1500k 4 104 | #define daveSpeed45k 5 105 | #define daveSpeed93k 6 106 | 107 | /* 108 | Some MPI function codes (yet unused ones may be incorrect). 109 | */ 110 | #define daveFuncOpenS7Connection 0xF0 111 | #define daveFuncRead 0x04 112 | #define daveFuncWrite 0x05 113 | #define daveFuncRequestDownload 0x1A 114 | #define daveFuncDownloadBlock 0x1B 115 | #define daveFuncDownloadEnded 0x1C 116 | #define daveFuncStartUpload 0x1D 117 | #define daveFuncUpload 0x1E 118 | #define daveFuncEndUpload 0x1F 119 | #define daveFuncInsertBlock 0x28 120 | /* 121 | S7 specific constants: 122 | */ 123 | #define daveBlockType_OB '8' 124 | #define daveBlockType_DB 'A' 125 | #define daveBlockType_SDB 'B' 126 | #define daveBlockType_FC 'C' 127 | #define daveBlockType_SFC 'D' 128 | #define daveBlockType_FB 'E' 129 | #define daveBlockType_SFB 'F' 130 | /* 131 | Use these constants for parameter "area" in daveReadBytes and daveWriteBytes 132 | */ 133 | #define daveSysInfo 0x3 /* System info of 200 family */ 134 | #define daveSysFlags 0x5 /* System flags of 200 family */ 135 | #define daveAnaIn 0x6 /* analog inputs of 200 family */ 136 | #define daveAnaOut 0x7 /* analog outputs of 200 family */ 137 | 138 | #define daveP 0x80 139 | #define daveInputs 0x81 140 | #define daveOutputs 0x82 141 | #define daveFlags 0x83 142 | #define daveDB 0x84 /* data blocks */ 143 | #define daveDI 0x85 /* instance data blocks */ 144 | #define daveLocal 0x86 /* not tested */ 145 | #define daveV 0x87 /* don't know what it is */ 146 | #define daveCounter 28 /* S7 counters */ 147 | #define daveTimer 29 /* S7 timers */ 148 | #define daveCounter200 30 /* IEC counters (200 family) */ 149 | #define daveTimer200 31 /* IEC timers (200 family) */ 150 | 151 | /** 152 | Library specific: 153 | **/ 154 | /* 155 | Result codes. Genarally, 0 means ok, 156 | >0 are results (also errors) reported by the PLC 157 | <0 means error reported by library code. 158 | */ 159 | #define daveResOK 0 /* means all ok */ 160 | #define daveResNoPeripheralAtAddress 1 /* CPU tells there is no peripheral at address */ 161 | #define daveResMultipleBitsNotSupported 6 /* CPU tells it does not support to read a bit block with a */ 162 | /* length other than 1 bit. */ 163 | #define daveResItemNotAvailable200 3 /* means a a piece of data is not available in the CPU, e.g. */ 164 | /* when trying to read a non existing DB or bit bloc of length<>1 */ 165 | /* This code seems to be specific to 200 family. */ 166 | 167 | #define daveResItemNotAvailable 10 /* means a a piece of data is not available in the CPU, e.g. */ 168 | /* when trying to read a non existing DB */ 169 | 170 | #define daveAddressOutOfRange 5 /* means the data address is beyond the CPUs address range */ 171 | #define daveWriteDataSizeMismatch 7 /* means the write data size doesn't fit item size */ 172 | #define daveResCannotEvaluatePDU -123 173 | #define daveResCPUNoData -124 174 | #define daveUnknownError -125 175 | #define daveEmptyResultError -126 176 | #define daveEmptyResultSetError -127 177 | #define daveResUnexpectedFunc -128 178 | #define daveResUnknownDataUnitSize -129 179 | 180 | #define daveResShortPacket -1024 181 | #define daveResTimeout -1025 182 | 183 | /* 184 | error code to message string conversion: 185 | Call this function to get an explanation for error codes returned by other functions. 186 | */ 187 | EXPORTSPEC char * DECL2 daveStrerror(int code); 188 | /* 189 | Copy an internal String into an external string buffer. This is needed to interface 190 | with Visual Basic. Maybe it is helpful elsewhere, too. 191 | */ 192 | EXPORTSPEC void DECL2 daveStringCopy(char * intString, char * extString); 193 | 194 | /* 195 | Max number of bytes in a single message. 196 | */ 197 | #define daveMaxRawLen 2048 198 | /* 199 | Some definitions for debugging: 200 | */ 201 | #define daveDebugRawRead 0x01 /* Show the single bytes received */ 202 | #define daveDebugSpecialChars 0x02 /* Show when special chars are read */ 203 | #define daveDebugRawWrite 0x04 /* Show the single bytes written */ 204 | #define daveDebugListReachables 0x08 /* Show the steps when determine devices in MPI net */ 205 | #define daveDebugInitAdapter 0x10 /* Show the steps when Initilizing the MPI adapter */ 206 | #define daveDebugConnect 0x20 /* Show the steps when connecting a PLC */ 207 | #define daveDebugPacket 0x40 208 | #define daveDebugByte 0x80 209 | #define daveDebugCompare 0x100 210 | #define daveDebugExchange 0x200 211 | #define daveDebugPDU 0x400 /* debug PDU handling */ 212 | #define daveDebugUpload 0x800 /* debug PDU loading program blocks from PLC */ 213 | #define daveDebugMPI 0x1000 214 | #define daveDebugPrintErrors 0x2000 /* Print error messages */ 215 | #define daveDebugPassive 0x4000 216 | #define daveDebugErrorReporting 0x8000 217 | #define daveDebugOpen 0x10000 /* print messages in openSocket and setPort */ 218 | 219 | #define daveDebugAll 0x1ffff 220 | /* 221 | set and read debug level: 222 | */ 223 | EXPORTSPEC void DECL2 daveSetDebug(int nDebug); 224 | EXPORTSPEC int DECL2 daveGetDebug(void); 225 | /* 226 | Some data types: 227 | */ 228 | #define uc unsigned char 229 | #define us unsigned short 230 | #define u32 unsigned int 231 | 232 | /* 233 | This is a wrapper for the serial or ethernet interface. This is here to make porting easier. 234 | */ 235 | 236 | typedef struct _daveConnection daveConnection; 237 | typedef struct _daveInterface daveInterface; 238 | 239 | /* 240 | Helper struct to manage PDUs. This is NOT the part of the packet I would call PDU, but 241 | a set of pointers that ease access to the "private parts" of a PDU. 242 | */ 243 | /* While gcc-3.3 can handle a 0 size struct (at least pointers to it), BCC can't. */ 244 | /* 245 | typedef struct { 246 | } PDU; 247 | */ 248 | typedef struct { 249 | uc * header; /* pointer to start of PDU (PDU header) */ 250 | uc * param; /* pointer to start of parameters inside PDU */ 251 | uc * data; /* pointer to start of data inside PDU */ 252 | uc * udata; /* pointer to start of data inside PDU */ 253 | int hlen; /* header length */ 254 | int plen; /* parameter length */ 255 | int dlen; /* data length */ 256 | int udlen; /* user or result data length */ 257 | } PDU; 258 | 259 | 260 | 261 | /* 262 | This groups an interface together with some information about it's properties 263 | in the library's context. 264 | */ 265 | struct _daveInterface { 266 | int _timeout; /* Timeout in microseconds used in transort. */ 267 | }; 268 | 269 | EXPORTSPEC daveInterface * DECL2 daveNewInterface(_daveOSserialType nfd, char * nname, int localMPI, int protocol, int speed); 270 | 271 | /* 272 | This holds data for a PLC connection; 273 | */ 274 | struct _daveConnection { 275 | int AnswLen; /* length of last message */ 276 | uc * resultPointer; /* used to retrieve single values from the result byte array */ 277 | int maxPDUlength; 278 | // int MPIAdr; /* The PLC's address */ 279 | }; 280 | 281 | /* 282 | Setup a new connection structure using an initialized 283 | daveInterface and PLC's MPI address. 284 | */ 285 | EXPORTSPEC daveConnection * DECL2 daveNewConnection(daveInterface * di, int MPI,int rack, int slot); 286 | 287 | typedef struct { 288 | uc type[2]; 289 | unsigned short count; 290 | } daveBlockTypeEntry; 291 | 292 | typedef struct { 293 | unsigned short number; 294 | uc type[2]; 295 | } daveBlockEntry; 296 | /** 297 | PDU handling: 298 | PDU is the central structure present in S7 communication. 299 | It is composed of a 10 or 12 byte header,a parameter block and a data block. 300 | When reading or writing values, the data field is itself composed of a data 301 | header followed by payload data 302 | **/ 303 | /* 304 | retrieve the answer 305 | */ 306 | EXPORTSPEC int DECL2 daveGetResponse(daveConnection * dc); 307 | /* 308 | send PDU to PLC 309 | */ 310 | EXPORTSPEC int DECL2 daveSendMessage(daveConnection * dc, PDU * p); 311 | 312 | /****** 313 | 314 | Utilities: 315 | 316 | ****/ 317 | /* 318 | Hex dump PDU: 319 | */ 320 | EXPORTSPEC void DECL2 _daveDumpPDU(PDU * p); 321 | 322 | /* 323 | Hex dump. Write the name followed by len bytes written in hex and a newline: 324 | */ 325 | EXPORTSPEC void DECL2 _daveDump(char * name,uc*b,int len); 326 | 327 | /* 328 | names for PLC objects: 329 | */ 330 | EXPORTSPEC char * DECL2 daveBlockName(uc bn); 331 | EXPORTSPEC char * DECL2 daveAreaName(uc n); 332 | 333 | /* 334 | swap functions: 335 | */ 336 | EXPORTSPEC short DECL2 daveSwapIed_16(short ff); 337 | EXPORTSPEC int DECL2 daveSwapIed_32(int ff); 338 | 339 | /** 340 | Data conversion convenience functions. The older set has been removed. 341 | Newer conversion routines. As the terms WORD, INT, INTEGER etc have different meanings 342 | for users of different programming languages and compilers, I choose to provide a new 343 | set of conversion routines named according to the bit length of the value used. The 'U' 344 | or 'S' stands for unsigned or signed. 345 | **/ 346 | /* 347 | Get a value from the position b points to. B is typically a pointer to a buffer that has 348 | been filled with daveReadBytes: 349 | */ 350 | EXPORTSPEC float DECL2 daveGetFloatAt(daveConnection * dc, int pos); 351 | 352 | 353 | EXPORTSPEC float DECL2 toPLCfloat(float ff); 354 | EXPORTSPEC int DECL2 daveToPLCfloat(float ff); 355 | 356 | 357 | 358 | EXPORTSPEC int DECL2 daveGetS8from(uc *b); 359 | EXPORTSPEC int DECL2 daveGetU8from(uc *b); 360 | EXPORTSPEC int DECL2 daveGetS16from(uc *b); 361 | EXPORTSPEC int DECL2 daveGetU16from(uc *b); 362 | EXPORTSPEC int DECL2 daveGetS32from(uc *b); 363 | EXPORTSPEC unsigned int DECL2 daveGetU32from(uc *b); 364 | EXPORTSPEC float DECL2 daveGetFloatfrom(uc *b); 365 | /* 366 | Get a value from the current position in the last result read on the connection dc. 367 | This will increment an internal pointer, so the next value is read from the position 368 | following this value. 369 | */ 370 | 371 | EXPORTSPEC int DECL2 daveGetS8(daveConnection * dc); 372 | EXPORTSPEC int DECL2 daveGetU8(daveConnection * dc); 373 | EXPORTSPEC int DECL2 daveGetS16(daveConnection * dc); 374 | EXPORTSPEC int DECL2 daveGetU16(daveConnection * dc); 375 | EXPORTSPEC int DECL2 daveGetS32(daveConnection * dc); 376 | EXPORTSPEC unsigned int DECL2 daveGetU32(daveConnection * dc); 377 | EXPORTSPEC float DECL2 daveGetFloat(daveConnection * dc); 378 | /* 379 | Get a value from a given position in the last result read on the connection dc. 380 | */ 381 | EXPORTSPEC int DECL2 daveGetS8At(daveConnection * dc, int pos); 382 | EXPORTSPEC int DECL2 daveGetU8At(daveConnection * dc, int pos); 383 | EXPORTSPEC int DECL2 daveGetS16At(daveConnection * dc, int pos); 384 | EXPORTSPEC int DECL2 daveGetU16At(daveConnection * dc, int pos); 385 | EXPORTSPEC int DECL2 daveGetS32At(daveConnection * dc, int pos); 386 | EXPORTSPEC unsigned int DECL2 daveGetU32At(daveConnection * dc, int pos); 387 | /* 388 | put one byte into buffer b: 389 | */ 390 | EXPORTSPEC uc * DECL2 davePut8(uc *b,int v); 391 | EXPORTSPEC uc * DECL2 davePut16(uc *b,int v); 392 | EXPORTSPEC uc * DECL2 davePut32(uc *b,int v); 393 | EXPORTSPEC uc * DECL2 davePutFloat(uc *b,float v); 394 | 395 | EXPORTSPEC void DECL2 davePut8At(uc *b, int pos, int v); 396 | EXPORTSPEC void DECL2 davePut16At(uc *b, int pos, int v); 397 | EXPORTSPEC void DECL2 davePut32At(uc *b, int pos, int v); 398 | EXPORTSPEC void DECL2 davePutFloatAt(uc *b,int pos, float v); 399 | /** 400 | Timer and Counter conversion functions: 401 | **/ 402 | /* 403 | get time in seconds from current read position: 404 | */ 405 | EXPORTSPEC float DECL2 daveGetSeconds(daveConnection * dc); 406 | /* 407 | get time in seconds from random position: 408 | */ 409 | EXPORTSPEC float DECL2 daveGetSecondsAt(daveConnection * dc, int pos); 410 | /* 411 | get counter value from current read position: 412 | */ 413 | EXPORTSPEC int DECL2 daveGetCounterValue(daveConnection * dc); 414 | /* 415 | get counter value from random read position: 416 | */ 417 | EXPORTSPEC int DECL2 daveGetCounterValueAt(daveConnection * dc,int pos); 418 | 419 | /* 420 | Functions to load blocks from PLC: 421 | */ 422 | EXPORTSPEC void DECL2 _daveConstructUpload(PDU *p,char blockType, int blockNr); 423 | 424 | EXPORTSPEC void DECL2 _daveConstructDoUpload(PDU * p, int uploadID); 425 | 426 | EXPORTSPEC void DECL2 _daveConstructEndUpload(PDU * p, int uploadID); 427 | /* 428 | Get the PLC's order code as ASCIIZ. Buf must provide space for 429 | 21 characters at least. 430 | */ 431 | 432 | #define daveOrderCodeSize 21 433 | EXPORTSPEC int DECL2 daveGetOrderCode(daveConnection * dc,char * buf); 434 | /* 435 | connect to a PLC. returns 0 on success. 436 | */ 437 | 438 | EXPORTSPEC int DECL2 daveConnectPLC(daveConnection * dc); 439 | 440 | /* 441 | Read len bytes from the PLC. Start determines the first byte. 442 | Area denotes whether the data comes from FLAGS, DATA BLOCKS, 443 | INPUTS or OUTPUTS, etc. 444 | DB is the number of the data block to be used. Set it to zero 445 | for other area types. 446 | Buffer is a pointer to a memory block provided by the calling 447 | program. If the pointer is not NULL, the result data will be copied thereto. 448 | Hence it must be big enough to take up the result. 449 | In any case, you can also retrieve the result data using the get macros 450 | on the connection pointer. 451 | 452 | RESTRICTION:There is no check for max. message len or automatic splitting into 453 | multiple messages. Use daveReadManyBytes() in case the data you want 454 | to read doesn't fit into a single PDU. 455 | 456 | */ 457 | EXPORTSPEC int DECL2 daveReadBytes(daveConnection * dc, int area, int DB, int start, int len, void * buffer); 458 | 459 | /* 460 | Read len bytes from the PLC. Start determines the first byte. 461 | In contrast to daveReadBytes(), this function can read blocks 462 | that are too long for a single transaction. To achieve this, 463 | the data is fetched with multiple subsequent read requests to 464 | the CPU. 465 | Area denotes whether the data comes from FLAGS, DATA BLOCKS, 466 | INPUTS or OUTPUTS, etc. 467 | DB is the number of the data block to be used. Set it to zero 468 | for other area types. 469 | Buffer is a pointer to a memory block provided by the calling 470 | program. It may not be NULL, the result data will be copied thereto. 471 | Hence it must be big enough to take up the result. 472 | You CANNOT read result bytes from the internal buffer of the 473 | daveConnection. This buffer is overwritten in each read request. 474 | */ 475 | EXPORTSPEC int DECL2 daveReadManyBytes(daveConnection * dc,int area, int DBnum, int start,int len, void * buffer); 476 | 477 | /* 478 | Write len bytes from buffer to the PLC. 479 | Start determines the first byte. 480 | Area denotes whether the data goes to FLAGS, DATA BLOCKS, 481 | INPUTS or OUTPUTS, etc. 482 | DB is the number of the data block to be used. Set it to zero 483 | for other area types. 484 | RESTRICTION: There is no check for max. message len or automatic splitting into 485 | multiple messages. Use daveReadManyBytes() in case the data you want 486 | to read doesn't fit into a single PDU. 487 | 488 | */ 489 | EXPORTSPEC int DECL2 daveWriteBytes(daveConnection * dc,int area, int DB, int start, int len, void * buffer); 490 | 491 | /* 492 | Write len bytes to the PLC. Start determines the first byte. 493 | In contrast to daveWriteBytes(), this function can write blocks 494 | that are too long for a single transaction. To achieve this, the 495 | the data is transported with multiple subsequent write requests to 496 | the CPU. 497 | Area denotes whether the data comes from FLAGS, DATA BLOCKS, 498 | INPUTS or OUTPUTS, etc. 499 | DB is the number of the data block to be used. Set it to zero 500 | for other area types. 501 | Buffer is a pointer to a memory block provided by the calling 502 | program. It may not be NULL. 503 | */ 504 | EXPORTSPEC int DECL2 daveWriteManyBytes(daveConnection * dc,int area, int DB, int start, int len, void * buffer); 505 | 506 | /* 507 | Bit manipulation: 508 | */ 509 | EXPORTSPEC int DECL2 daveReadBits(daveConnection * dc, int area, int DB, int start, int len, void * buffer); 510 | EXPORTSPEC int DECL2 daveWriteBits(daveConnection * dc,int area, int DB, int start, int len, void * buffer); 511 | EXPORTSPEC int DECL2 daveSetBit(daveConnection * dc,int area, int DB, int byteAdr, int bitAdr); 512 | EXPORTSPEC int DECL2 daveClrBit(daveConnection * dc,int area, int DB, int byteAdr, int bitAdr); 513 | 514 | /* 515 | PLC diagnostic and inventory functions: 516 | */ 517 | EXPORTSPEC int DECL2 daveReadSZL(daveConnection * dc, int ID, int index, void * buf, int buflen); 518 | EXPORTSPEC int DECL2 daveListBlocksOfType(daveConnection * dc,uc type,daveBlockEntry * buf); 519 | EXPORTSPEC int DECL2 daveListBlocks(daveConnection * dc,daveBlockTypeEntry * buf); 520 | /* 521 | PLC program read functions: 522 | */ 523 | EXPORTSPEC int DECL2 initUpload(daveConnection * dc,char blockType, int blockNr, int * uploadID); 524 | EXPORTSPEC int DECL2 doUpload(daveConnection*dc, int * more, uc**buffer, int*len, int uploadID); 525 | EXPORTSPEC int DECL2 endUpload(daveConnection*dc, int uploadID); 526 | EXPORTSPEC int DECL2 daveGetProgramBlock(daveConnection * dc, int blockType, int number, char* buffer, int * length); 527 | /* 528 | PLC run/stop control functions: 529 | */ 530 | EXPORTSPEC int DECL2 daveStop(daveConnection*dc); 531 | EXPORTSPEC int DECL2 daveStart(daveConnection*dc); 532 | /* 533 | PLC special commands 534 | */ 535 | EXPORTSPEC int DECL2 daveCopyRAMtoROM(daveConnection*dc); 536 | 537 | EXPORTSPEC int DECL2 daveForce200(daveConnection * dc, int area, int start, int val); 538 | /* 539 | Multiple variable support: 540 | */ 541 | typedef struct { 542 | int error; 543 | int length; 544 | uc * bytes; 545 | } daveResult; 546 | 547 | typedef struct { 548 | int numResults; 549 | daveResult * results; 550 | } daveResultSet; 551 | 552 | 553 | /* use this to initialize a multivariable read: */ 554 | EXPORTSPEC void DECL2 davePrepareReadRequest(daveConnection * dc, PDU *p); 555 | /* Adds a new variable to a prepared request: */ 556 | EXPORTSPEC void DECL2 daveAddVarToReadRequest(PDU *p, int area, int DBnum, int start, int bytes); 557 | /* Executes the complete request. */ 558 | EXPORTSPEC int DECL2 daveExecReadRequest(daveConnection * dc, PDU *p, daveResultSet * rl); 559 | /* Lets the functions daveGet work on the n-th result: */ 560 | EXPORTSPEC int DECL2 daveUseResult(daveConnection * dc, daveResultSet * rl, int n); 561 | /* Frees the memory occupied by the result structure */ 562 | EXPORTSPEC void DECL2 daveFreeResults(daveResultSet * rl); 563 | /* Adds a new bit variable to a prepared request: */ 564 | EXPORTSPEC void DECL2 daveAddBitVarToReadRequest(PDU *p, int area, int DBnum, int start, int byteCount); 565 | 566 | /* use this to initialize a multivariable write: */ 567 | EXPORTSPEC void DECL2 davePrepareWriteRequest(daveConnection * dc, PDU *p); 568 | /* Adds a new variable to a prepared request: */ 569 | EXPORTSPEC void DECL2 daveAddVarToWriteRequest(PDU *p, int area, int DBnum, int start, int bytes, void * buffer); 570 | /* Adds a new bit variable to a prepared write request: */ 571 | EXPORTSPEC void DECL2 daveAddBitVarToWriteRequest(PDU *p, int area, int DBnum, int start, int byteCount, void * buffer); 572 | /* Executes the complete request. */ 573 | EXPORTSPEC int DECL2 daveExecWriteRequest(daveConnection * dc, PDU *p, daveResultSet * rl); 574 | 575 | 576 | EXPORTSPEC int DECL2 daveInitAdapter(daveInterface * di); 577 | EXPORTSPEC int DECL2 daveConnectPLC(daveConnection * dc); 578 | EXPORTSPEC int DECL2 daveDisconnectPLC(daveConnection * dc); 579 | 580 | EXPORTSPEC int DECL2 daveDisconnectAdapter(daveInterface * di); 581 | EXPORTSPEC int DECL2 daveListReachablePartners(daveInterface * di,char * buf); 582 | 583 | /* MPI specific functions */ 584 | 585 | #define daveMPIReachable 0x30 586 | #define daveMPIActive 0x30 587 | #define daveMPIPassive 0x00 588 | #define daveMPIunused 0x10 589 | #define davePartnerListSize 126 590 | /** 591 | C# interoperability: 592 | **/ 593 | EXPORTSPEC void DECL2 daveSetTimeout(daveInterface * di, int tmo); 594 | EXPORTSPEC int DECL2 daveGetTimeout(daveInterface * di); 595 | 596 | EXPORTSPEC char * DECL2 daveGetName(daveInterface * di); 597 | 598 | EXPORTSPEC int DECL2 daveGetMPIAdr(daveConnection * dc); 599 | EXPORTSPEC int DECL2 daveGetAnswLen(daveConnection * dc); 600 | EXPORTSPEC int DECL2 daveGetMaxPDULen(daveConnection * dc); 601 | EXPORTSPEC daveResultSet * DECL2 daveNewResultSet(); 602 | EXPORTSPEC void DECL2 daveFree(void * dc); 603 | EXPORTSPEC PDU * DECL2 daveNewPDU(); 604 | EXPORTSPEC int DECL2 daveGetErrorOfResult(daveResultSet *,int number); 605 | 606 | /* 607 | Special function do disconnect arbitrary connections on IBH-Link: 608 | */ 609 | EXPORTSPEC int DECL2 daveForceDisconnectIBH(daveInterface * di, int src, int dest, int mpi); 610 | /* 611 | Special function do reset an IBH-Link: 612 | */ 613 | EXPORTSPEC int DECL2 daveResetIBH(daveInterface * di); 614 | /** 615 | Program Block from PLC: 616 | */ 617 | EXPORTSPEC int DECL2 daveGetProgramBlock(daveConnection * dc, int blockType, int number, char* buffer, int * length); 618 | /** 619 | PLC realtime clock handling: 620 | */ 621 | /* 622 | read out clock: 623 | */ 624 | EXPORTSPEC int DECL2 daveReadPLCTime(daveConnection * dc); 625 | /* 626 | set clock to a value given by user: 627 | */ 628 | EXPORTSPEC int DECL2 daveSetPLCTime(daveConnection * dc,uc * ts); 629 | /* 630 | set clock to PC system clock: 631 | */ 632 | EXPORTSPEC int DECL2 daveSetPLCTimeToSystime(daveConnection * dc); 633 | 634 | EXPORTSPEC uc DECL2 daveToBCD(uc i); 635 | EXPORTSPEC uc DECL2 daveFromBCD(uc i); 636 | 637 | #endif /* _nodave */ 638 | 639 | #ifdef __cplusplus 640 | } 641 | #endif 642 | 643 | 644 | /* 645 | Changes: 646 | 04/10/05 first version. 647 | 09/11/05 added read/write functions for long blocks of data. 648 | 10/26/07 fixed __cplusplus 649 | */ 650 | -------------------------------------------------------------------------------- /src/logo.coffee: -------------------------------------------------------------------------------- 1 | ### 2 | Copyright (c) 2012 - 2017, Markus Kohlhase 3 | ### 4 | 5 | fs = require "fs" 6 | net = require "net" 7 | ev = require "events" 8 | dave = (require "bindings") 'addon' 9 | bits = require "bits" 10 | 11 | NOT_CONNECTED = "plc is not connected" 12 | 13 | class Logo extends ev.EventEmitter 14 | 15 | constructor: (@ip, opt={}) -> 16 | unless typeof @ip is "string" 17 | throw new Error "invalid ip address" 18 | 19 | { @inputs, @markers, @timeout, @interval } = opt 20 | 21 | ### public properties ### 22 | 23 | @inputs ?= 8 24 | @markers ?= 8 25 | @interval ?= 250 26 | @simulate ?= opt.simulate 27 | @state = {} 28 | 29 | ### private properties ### 30 | 31 | @_dave = new dave.NoDave @ip 32 | 33 | @_onInterval ?= -> 34 | @_actionConfig = opt.actions or {} 35 | @_stateConfig = opt.states or {} 36 | @_virtualState = {} 37 | 38 | if @simulate 39 | @_simMarkers = 0 40 | @_simInputs = 0 41 | 42 | process.nextTick @connect if opt.autoConnect is true 43 | 44 | connected: false 45 | 46 | connect: -> 47 | if @simulate 48 | @isConnected = true 49 | @emit "connect" 50 | return 51 | 52 | if not @_socket? 53 | @_socket = new net.Socket 54 | @_socket.setTimeout @timeout if @timeout 55 | 56 | @_socket.on "timeout", (ev) => 57 | @emit "timeout", ev 58 | 59 | @_socket.on "error", (err) => 60 | @isConnected = false 61 | @emit "error", err 62 | 63 | @_socket.on "close", (ev) => 64 | @isConnected = false 65 | @emit "disconnect", ev 66 | 67 | @_socket.on "connect", => 68 | e = @_dave.connect @_socket._handle.fd, @timeout 69 | unless e instanceof Error 70 | @isConnected = true 71 | setImmediate => @emit "connect" 72 | else 73 | setImmediate => @emit "error", e 74 | return e 75 | 76 | @_socket.connect 102, @ip 77 | 78 | disconnect: -> 79 | @isConnected = false 80 | @_socket?.destroy() 81 | 82 | setMarker: (m) -> 83 | return new Error NOT_CONNECTED unless @isConnected 84 | if @simulate 85 | @_simMarkers = bits.set @_simMarkers, m 86 | else 87 | if (current = @_dave.getMarkers()) instanceof Error 88 | return current 89 | @_dave.setMarkers bits.set current, m 90 | 91 | clearMarker: (m) -> 92 | return new Error NOT_CONNECTED unless @isConnected 93 | if @simulate 94 | @_simMarkers = bits.clear @_simMarkers, m 95 | else 96 | if (current = @_dave.getMarkers()) instanceof Error 97 | return current 98 | @_dave.setMarkers bits.clear current, m 99 | 100 | getMarker: (m) -> 101 | return new Error NOT_CONNECTED unless @isConnected 102 | if @simulate 103 | bits.test @_simMarkers, m 104 | else 105 | if (current = @_dave.getMarkers()) instanceof Error 106 | return current 107 | bits.test current, m 108 | 109 | getMarkers: -> 110 | return new Error NOT_CONNECTED unless @isConnected 111 | markers = 112 | if @simulate then @_simMarkers 113 | else @_dave.getMarkers() 114 | 115 | return markers if markers instanceof Error 116 | 117 | for i in [0...@markers] 118 | bits.test markers, i 119 | 120 | setSimulatedInput: (i) -> 121 | return new Error NOT_CONNECTED unless @isConnected and @simulate 122 | @_simInputs = bits.set @_simInputs, i 123 | 124 | clearSimulatedInput: (i) -> 125 | return new Error NOT_CONNECTED unless @isConnected and @simulate 126 | @_simInputs = bits.clear @_simInputs, i 127 | 128 | setSimulatedState: (state, value) -> 129 | if @simulate and (x = @_stateConfig[state])? 130 | if x.input? 131 | if value is true 132 | @setSimulatedInput x.input 133 | else if value is false 134 | @clearSimulatedInput x.input 135 | else if x.marker? 136 | if value is true 137 | @setMarker x.marker 138 | else if value is false 139 | @clearMarker x.marker 140 | 141 | getInput: (i) -> 142 | return new Error NOT_CONNECTED unless @isConnected 143 | if @simulate 144 | bits.test @_simInputs, i 145 | else 146 | if (current = @_dave.getInputs()) instanceof Error 147 | return current 148 | bits.test current, i 149 | 150 | getInputs: -> 151 | return new Error NOT_CONNECTED unless @isConnected 152 | inputs = 153 | if @simulate then @_simInputs 154 | else @_dave.getInputs() 155 | return inputs if inputs instanceof Error 156 | for i in [0...@inputs] 157 | bits.test inputs, i 158 | 159 | _getState: (stateName, cfg, inputs, markers) -> 160 | s = 161 | if cfg.input? then inputs[cfg.input] 162 | else if cfg.marker? then markers[cfg.marker] 163 | else if cfg.virtual? 164 | if (x=@_virtualState[stateName])? then x else cfg.default 165 | 166 | if cfg.inverse then not s else s 167 | 168 | getState: -> 169 | s = {} 170 | unless @isConnected 171 | console.warn "device with ip #{@ip} is offline" 172 | return s 173 | i = @getInputs() 174 | m = @getMarkers() 175 | if i instanceof Error or m instanceof Error 176 | console.warn "could not read state of #{@ip}" 177 | @disconnect() 178 | return s 179 | else 180 | for stateName, cfg of @_stateConfig 181 | s[stateName] = @_getState stateName, cfg, i, m 182 | s 183 | 184 | triggerAction: (action) -> 185 | unless typeof action is 'string' 186 | return console.warn "invalid action: #{action}" 187 | tasks = @_actionConfig[action] 188 | return unless tasks? and @isConnected 189 | for t in tasks 190 | if t.type in ['set', 'clear'] 191 | if (typeof t.marker is 'number' or t.marker instanceof Array) 192 | switch t.type 193 | when 'clear' then @clearMarker t.marker 194 | when 'set' then @setMarker t.marker 195 | if (typeof t.input is 'number' or t.input instanceof Array) and 196 | (t.simulate and @simulate) 197 | switch t.type 198 | when 'clear' then @clearSimulatedInput t.input 199 | when 'set' then @setSimulatedInput t.input 200 | else if t.type is 'alias' and t.actions instanceof Array 201 | @triggerAction a for a in t.actions when a isnt action 202 | @_onStateInterval() 203 | 204 | setVirtualState: (state, val) -> 205 | if @_stateConfig[state]?.virtual? 206 | @_virtualState[state] = v 207 | 208 | startWatching: (interval) -> 209 | unless @_stateIntervalTimer? 210 | @_stateIntervalTimer = 211 | setInterval @_onStateInterval, interval or @interval 212 | unless @_connIntervalTimer? 213 | @_connIntervalTimer = setInterval @_onConnectInterval, 8000 214 | 215 | stopWatching: -> 216 | clearInterval @_stateIntervalTimer 217 | clearInterval @_connIntervalTimer 218 | 219 | _onStateInterval: => 220 | return unless @isConnected 221 | s = @getState() 222 | change = false 223 | 224 | @_onInterval s 225 | 226 | for stateName, state of s 227 | if (x = @state?[stateName])? 228 | if x isnt state 229 | change = true 230 | break 231 | else 232 | change = true 233 | break 234 | 235 | @state = s 236 | @emit "state-change", s if change 237 | @emit "state", s 238 | 239 | _onConnectInterval: => @connect() unless @isConnected 240 | 241 | module.exports = Logo 242 | -------------------------------------------------------------------------------- /src/node_nodave.cc: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 7* Copyright (c) 2012 - 2017, Markus Kohlhase * 3 | ******************************************************************************/ 4 | 5 | #include "node_nodave.h" 6 | 7 | using namespace v8; 8 | 9 | Nan::Persistent NoDave::constructor; 10 | 11 | const int slot = 0; 12 | const int rack = 1; 13 | const int useProtocol = daveProtoISOTCP; 14 | const int timeout = 5000000; 15 | const int port = 102; 16 | 17 | NAN_MODULE_INIT(NoDave::Init) { 18 | 19 | // Prepare constructor template 20 | Local tpl = Nan::New(New); 21 | tpl->SetClassName(Nan::New("NoDave").ToLocalChecked()); 22 | tpl->InstanceTemplate()->SetInternalFieldCount(1); 23 | 24 | // Prototype 25 | Nan::SetPrototypeMethod(tpl, "connect", Connect); 26 | Nan::SetPrototypeMethod(tpl, "getMarkers", GetMarkers); 27 | Nan::SetPrototypeMethod(tpl, "setMarkers", SetMarkers); 28 | Nan::SetPrototypeMethod(tpl, "getInputs", GetInputs); 29 | 30 | constructor.Reset(Nan::GetFunction(tpl).ToLocalChecked()); 31 | Nan::Set(target, Nan::New("NoDave").ToLocalChecked(), Nan::GetFunction(tpl).ToLocalChecked()); 32 | 33 | } 34 | 35 | NoDave::NoDave(void) : ObjectWrap() { 36 | } 37 | 38 | NoDave::~NoDave() { 39 | } 40 | 41 | NAN_METHOD(NoDave::New) { 42 | 43 | if (info.IsConstructCall()) { 44 | // Invoked as constructor: `new NoDave(...)` 45 | NoDave* obj = new NoDave(); 46 | obj->Wrap(info.This()); 47 | info.GetReturnValue().Set(info.This()); 48 | } else { 49 | 50 | // Invoked as plain function `NoDave(...)`, turn into construct call. 51 | 52 | const int argc = 1; 53 | Local argv[argc] = { info[0] }; 54 | Local cons = Nan::New(constructor); 55 | info.GetReturnValue().Set(cons->NewInstance(argc, argv)); 56 | } 57 | } 58 | 59 | NAN_METHOD(NoDave::Connect) { 60 | int fd = -1; 61 | int to = timeout; 62 | daveInterface* di; 63 | 64 | if (info.Length() < 1 || !info[0]->IsNumber()) 65 | info.GetReturnValue().Set(Nan::TypeError("First argument must be a file descriptor")); 66 | 67 | fd = info[0]->ToInteger()->Value(); 68 | 69 | NoDave* d = ObjectWrap::Unwrap(info.Holder()); 70 | d->fds.rfd = fd; 71 | d->fds.wfd = d->fds.rfd; 72 | 73 | if (d->fds.rfd>0) { 74 | 75 | di = daveNewInterface(d->fds, "IF1", 0, useProtocol, daveSpeed187k); 76 | 77 | if (info.Length() > 1 && info[1]->IsNumber()) 78 | to = info[1]->ToInteger()->Value(); 79 | 80 | daveSetTimeout(di, to); 81 | 82 | d->dc = daveNewConnection(di, 2, rack, slot); 83 | 84 | if (daveConnectPLC(d->dc)) 85 | info.GetReturnValue().Set(Nan::Error("Could not connect")); 86 | return; 87 | } 88 | info.GetReturnValue().Set(Nan::Error("Could not connect")); 89 | } 90 | 91 | NAN_METHOD(NoDave::GetMarkers) { 92 | NoDave* d = ObjectWrap::Unwrap(info.Holder()); 93 | int buff[] = { 0 }; 94 | if (daveReadBytes(d->dc, daveFlags, 0,0, 2, &buff)) 95 | info.GetReturnValue().Set(Nan::Error("Could not read markers")); 96 | info.GetReturnValue().Set(Nan::New(buff[0])); 97 | } 98 | 99 | NAN_METHOD(NoDave::SetMarkers) { 100 | int val; 101 | if (info.Length() < 1 || !info[0]->IsNumber() ) 102 | info.GetReturnValue().Set(Nan::Error("First argument must be an integer")); 103 | val = info[0]->ToInteger()->Value(); 104 | int buff[] = { val }; 105 | NoDave* d = ObjectWrap::Unwrap(info.Holder()); 106 | if (daveWriteBytes(d->dc, daveFlags, 0, 0, 2, &buff)) 107 | info.GetReturnValue().Set(Nan::Error("Could not set markers")); 108 | return; 109 | } 110 | 111 | NAN_METHOD(NoDave::GetInputs) { 112 | int buff[] = { 0 }; 113 | NoDave* d = ObjectWrap::Unwrap(info.Holder()); 114 | if (daveReadBytes(d->dc, daveInputs, 0, 0, 1, &buff)) 115 | info.GetReturnValue().Set(Nan::Error("Could not read inputs")); 116 | info.GetReturnValue().Set(Nan::New(buff[0])); 117 | } 118 | -------------------------------------------------------------------------------- /src/node_nodave.h: -------------------------------------------------------------------------------- 1 | #ifndef NODE_NODAVE_H 2 | #define NODE_NODAVE_H 3 | 4 | #ifndef LINUX 5 | #define LINUX 6 | #endif 7 | 8 | #include "libnodave/nodavesimple.h" 9 | 10 | #include 11 | 12 | class NoDave : public Nan::ObjectWrap { 13 | 14 | public: 15 | static NAN_MODULE_INIT(Init); 16 | 17 | private: 18 | explicit NoDave(void); 19 | ~NoDave(); 20 | 21 | static NAN_METHOD(New); 22 | static NAN_METHOD(Connect); 23 | static NAN_METHOD(GetMarkers); 24 | static NAN_METHOD(SetMarkers); 25 | static NAN_METHOD(GetInputs); 26 | 27 | static Nan::Persistent constructor; 28 | 29 | daveConnection* dc; 30 | _daveOSserialType fds; 31 | }; 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /src/plc.coffee: -------------------------------------------------------------------------------- 1 | try 2 | v = require("../package.json").version 3 | catch e 4 | v = undefined 5 | 6 | module.exports = 7 | 8 | VERSION: v 9 | Logo: require './logo' 10 | --------------------------------------------------------------------------------