Skip to content

Commit d9f1a0b

Browse files
committed
update: snap7 -> 1.3.0, NAN -> 1.5.1
1 parent 7f3af4e commit d9f1a0b

32 files changed

Lines changed: 414 additions & 212 deletions

deps/snap7/HISTORY.txt

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,54 @@
1+
======================================================================[2015-01-01]
2+
Version 1.3.0 - Platform / Comfort release (fully compatible with 1.0.0)
3+
----------------------------------------------------------------------------------
4+
5+
Platform
6+
- Runtime Big-Endian architecture support. No compilers swithes are needed.
7+
- Sun Sparc and Mips BE architectures are now supported.
8+
9+
Comfort
10+
- Added WinForm.net demos (C# and VB)
11+
- Improved documentation (added .NET chapter for beginners *please read it*)
12+
Added also a chapter about Siemens data format.
13+
- Added Helper class/functions
14+
15+
==================================================================================
16+
[Added]
17+
18+
19+
- Helper class/function to insert/extract S7 typed vars from a byte[] buffer.
20+
You will find them into the wrappers (.net/Pascal/C++)
21+
- Solaris Sparc support
22+
(Thanks to Rolf Stalder for makefiles)
23+
- .Net Winform small demos
24+
- .Net solution for rebuilding snap7.net.cs
25+
26+
27+
[Improved]
28+
29+
- Unix, now the client doesn't need root priviledges to perform the SmartConnect.
30+
(Thanks to Rolf Stalder)
31+
- Solaris now uses standard pthreads.
32+
(Thanks to Rolf Stalder)
33+
- Read/WriteMultiVars now checks in advance if the data fits into the PDU size.
34+
- .net S7Client.ReadMultivars (and Write) was improved.
35+
(Thanks to LanceL who made it)
36+
- S7Client now checks if it's connected before do anything.
37+
(Thanks to Mathias K�sel for reporting it)
38+
39+
40+
[Latest OS]
41+
42+
- Tested with Ubuntu 14.10 (32/64)
43+
- Tested with Windows 10 Technical Preview (32/64)
44+
45+
46+
[fixed]
47+
48+
- Fixed some Typo errors into snap7.net.cs
49+
- Fixed a small bug into Read/WriteMultiVars
50+
51+
152
======================================================================[2014-04-17]
253
Version 1.2.1 - Bugfix/Small changes release (fully compatible with 1.0.0)
354
----------------------------------------------------------------------------------
@@ -151,3 +202,7 @@ Version 1.0.0
151202
- First public release.
152203

153204
==================================================================================
205+
206+
207+
208+

deps/snap7/src/core/s7_client.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*=============================================================================|
2-
| PROJECT SNAP7 1.2.1 |
2+
| PROJECT SNAP7 1.3.0 |
33
|==============================================================================|
4-
| Copyright (C) 2013, Davide Nardella |
4+
| Copyright (C) 2013, 2015 Davide Nardella |
55
| All rights reserved. |
66
|==============================================================================|
77
| SNAP7 is free software: you can redistribute it and/or modify |

deps/snap7/src/core/s7_client.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*=============================================================================|
2-
| PROJECT SNAP7 1.2.1 |
2+
| PROJECT SNAP7 1.3.0 |
33
|==============================================================================|
4-
| Copyright (C) 2013, Davide Nardella |
4+
| Copyright (C) 2013, 2015 Davide Nardella |
55
| All rights reserved. |
66
|==============================================================================|
77
| SNAP7 is free software: you can redistribute it and/or modify |

deps/snap7/src/core/s7_firmware.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*=============================================================================|
2-
| PROJECT SNAP7 1.2.1 |
2+
| PROJECT SNAP7 1.3.0 |
33
|==============================================================================|
4-
| Copyright (C) 2013, Davide Nardella |
4+
| Copyright (C) 2013, 2015 Davide Nardella |
55
| All rights reserved. |
66
|==============================================================================|
77
| SNAP7 is free software: you can redistribute it and/or modify |
@@ -1190,7 +1190,7 @@
11901190
};
11911191

11921192
byte SZL_ID_0131_IDX_0001[52] = {
1193-
0xFF,0x09,0x00,0x30,0x01,0x31,0x00,0x01,0x00,0x28,0x00,0x01,0x00,0x01,
1193+
0xFF,0x09,0x00,0x30,0x01,0x31,0x00,0x01,0x00,0x28,0x00,0x01,0x00,0x01,
11941194
0x08,0x00, // PDU SIZE : We expose 2048 00F0
11951195
0x04,0x00, // Max Commections : We expose 1024 0010
11961196
0x00,0xB7,0x1B,0x00,0x00,0x02,0xDC,0x6C,0x05,0xF5,0xE1,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
@@ -1204,8 +1204,9 @@
12041204
};
12051205

12061206
byte SZL_ID_0131_IDX_0003[52] = {
1207-
0xFF,0x09,0x00,0x30,0x01,0x31,0x00,0x03,0x00,0x28,0x00,0x01,0x00,0x03,0x7F,0xFC,0x83,0x01,0x00,
1208-
0xF0,0x00,0x10,0x00,0x01,0x02,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
1207+
0xFF,0x09,0x00,0x30,0x01,0x31,0x00,0x03,0x00,0x28,0x00,0x01,0x00,0x03,0x7F,0xFC,0x83,0x01,
1208+
0x00,0xF0, // Max size of consistently readable data (will be set = PDU size)
1209+
0x00,0x10,0x00,0x01,0x02,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
12091210
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
12101211
};
12111212

deps/snap7/src/core/s7_isotcp.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*=============================================================================|
2-
| PROJECT SNAP7 1.2.1 |
2+
| PROJECT SNAP7 1.3.0 |
33
|==============================================================================|
4-
| Copyright (C) 2013, Davide Nardella |
4+
| Copyright (C) 2013, 2015 Davide Nardella |
55
| All rights reserved. |
66
|==============================================================================|
77
| SNAP7 is free software: you can redistribute it and/or modify |

deps/snap7/src/core/s7_isotcp.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*=============================================================================|
2-
| PROJECT SNAP7 1.2.1 |
2+
| PROJECT SNAP7 1.3.0 |
33
|==============================================================================|
4-
| Copyright (C) 2013, Davide Nardella |
4+
| Copyright (C) 2013, 2015 Davide Nardella |
55
| All rights reserved. |
66
|==============================================================================|
77
| SNAP7 is free software: you can redistribute it and/or modify |

deps/snap7/src/core/s7_micro_client.cpp

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*=============================================================================|
2-
| PROJECT SNAP7 1.2.1 |
2+
| PROJECT SNAP7 1.3.0 |
33
|==============================================================================|
4-
| Copyright (C) 2013, Davide Nardella |
4+
| Copyright (C) 2013, 2015 Davide Nardella |
55
| All rights reserved. |
66
|==============================================================================|
77
| SNAP7 is free software: you can redistribute it and/or modify |
@@ -380,6 +380,8 @@ int TSnap7MicroClient::opReadMultiVars()
380380
};
381381

382382
IsoSize=RPSize+sizeof(TS7ReqHeader);
383+
if (IsoSize>PDULength)
384+
return errCliSizeOverPDU;
383385
Result=isoExchangeBuffer(0,IsoSize);
384386
// Function level error
385387
if (Answer->Error!=0)
@@ -535,8 +537,8 @@ int TSnap7MicroClient::opWriteMultiVars()
535537

536538
memcpy(ReqData[c]->Data, Item->pdata, Size);
537539

538-
if ((Size % 2)!=0)
539-
Size++; // Skip fill byte for Odd frame
540+
if ((Size % 2) != 0 && (ItemsCount - c != 1))
541+
Size++; // Skip fill byte for Odd frame (except for the last one)
540542

541543
Offset+=(4+Size); // next item
542544
Item++;
@@ -545,6 +547,8 @@ int TSnap7MicroClient::opWriteMultiVars()
545547
PDUH_out->DataLen=SwapWord(word(Offset));
546548

547549
IsoSize=RPSize+sizeof(TS7ReqHeader)+int(Offset);
550+
if (IsoSize>PDULength)
551+
return errCliSizeOverPDU;
548552
Result=isoExchangeBuffer(0,IsoSize);
549553
// Function level error
550554
if (Answer->Error!=0)
@@ -869,7 +873,7 @@ int TSnap7MicroClient::opAgBlockInfo()
869873
{
870874
if (ResParams->ErrNo==0)
871875
{
872-
if (SwapWord(ResData->Length)<78)
876+
if (SwapWord(ResData->Length)<40) // 78
873877
return errCliInvalidPlcAnswer;
874878
if (ResData->RetVal==0xFF) // <-- 0xFF means Result OK
875879
{
@@ -1352,7 +1356,7 @@ int TSnap7MicroClient::opDownload()
13521356
Answer =PS7ResHeader23(&PDU.Payload);
13531357
ResParams=PResDownloadParams(pbyte(Answer)+ResHeaderSize23);
13541358
ResData =PResDownloadDataHeader(pbyte(ResParams)+sizeof(TResDownloadParams));
1355-
Target =pbyte(ResData)+sizeof(PResDownloadDataHeader);
1359+
Target =pbyte(ResData)+sizeof(TResDownloadDataHeader);
13561360
Source =pbyte(&opData)+Offset;
13571361

13581362
Result=isoRecvBuffer(0,Size);
@@ -1459,7 +1463,7 @@ int TSnap7MicroClient::opDownload()
14591463
// Init Params
14601464
ReqParams->Fun = pduControl;
14611465
ReqParams->Uk7[0]=0x00;
1462-
ReqParams->Uk7[1]=0x01;
1466+
ReqParams->Uk7[1]=0x00;
14631467
ReqParams->Uk7[2]=0x00;
14641468
ReqParams->Uk7[3]=0x00;
14651469
ReqParams->Uk7[4]=0x00;

deps/snap7/src/core/s7_micro_client.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*=============================================================================|
2-
| PROJECT SNAP7 1.2.1 |
2+
| PROJECT SNAP7 1.3.0 |
33
|==============================================================================|
4-
| Copyright (C) 2013, 2014 Davide Nardella |
4+
| Copyright (C) 2013, 2015 Davide Nardella |
55
| All rights reserved. |
66
|==============================================================================|
77
| SNAP7 is free software: you can redistribute it and/or modify |

deps/snap7/src/core/s7_partner.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*=============================================================================|
2-
| PROJECT SNAP7 1.2.1 |
2+
| PROJECT SNAP7 1.3.0 |
33
|==============================================================================|
4-
| Copyright (C) 2013, 2014 Davide Nardella |
4+
| Copyright (C) 2013, 2015 Davide Nardella |
55
| All rights reserved. |
66
|==============================================================================|
77
| SNAP7 is free software: you can redistribute it and/or modify |

deps/snap7/src/core/s7_partner.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*=============================================================================|
2-
| PROJECT SNAP7 1.2.1 |
2+
| PROJECT SNAP7 1.3.0 |
33
|==============================================================================|
4-
| Copyright (C) 2013, 2014 Davide Nardella |
4+
| Copyright (C) 2013, 2015 Davide Nardella |
55
| All rights reserved. |
66
|==============================================================================|
77
| SNAP7 is free software: you can redistribute it and/or modify |

0 commit comments

Comments
 (0)