-
Notifications
You must be signed in to change notification settings - Fork 3
/
goplctag.go
585 lines (532 loc) · 21.2 KB
/
goplctag.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
// Mozilla Public License 2.0, and LGPL License.
// WARNING: This file has automatically been generated
// Code generated by https://git.io/c-for-go. DO NOT EDIT.
package goplctag
/*
#cgo pkg-config: libplctag
#include "libplctag.h"
#include "callbacks.h"
#include <stdlib.h>
#include "cgo_helpers.h"
*/
import "C"
import (
"runtime"
"unsafe"
)
// DecodeError function as declared in include/libplctag.h:119
func DecodeError(err int32) string {
cerr, cerrAllocMap := (C.int)(err), cgoAllocsUnknown
__ret := C.plc_tag_decode_error(cerr)
runtime.KeepAlive(cerrAllocMap)
__v := packPCharString(__ret)
return __v
}
// SetDebugLevel function as declared in include/libplctag.h:137
func SetDebugLevel(debugLevel int32) {
cdebugLevel, cdebugLevelAllocMap := (C.int)(debugLevel), cgoAllocsUnknown
C.plc_tag_set_debug_level(cdebugLevel)
runtime.KeepAlive(cdebugLevelAllocMap)
}
// CheckLibVersion function as declared in include/libplctag.h:163
func CheckLibVersion(reqMajor int32, reqMinor int32, reqPatch int32) int32 {
creqMajor, creqMajorAllocMap := (C.int)(reqMajor), cgoAllocsUnknown
creqMinor, creqMinorAllocMap := (C.int)(reqMinor), cgoAllocsUnknown
creqPatch, creqPatchAllocMap := (C.int)(reqPatch), cgoAllocsUnknown
__ret := C.plc_tag_check_lib_version(creqMajor, creqMinor, creqPatch)
runtime.KeepAlive(creqPatchAllocMap)
runtime.KeepAlive(creqMinorAllocMap)
runtime.KeepAlive(creqMajorAllocMap)
__v := (int32)(__ret)
return __v
}
// Create function as declared in include/libplctag.h:196
func Create(attribStr string, timeout int32) int32 {
cattribStr, cattribStrAllocMap := unpackPCharString(attribStr)
ctimeout, ctimeoutAllocMap := (C.int)(timeout), cgoAllocsUnknown
__ret := C.plc_tag_create(cattribStr, ctimeout)
runtime.KeepAlive(ctimeoutAllocMap)
runtime.KeepAlive(cattribStrAllocMap)
__v := (int32)(__ret)
return __v
}
// Shutdown function as declared in include/libplctag.h:229
func Shutdown() {
C.plc_tag_shutdown()
}
// UnregisterCallback function as declared in include/libplctag.h:300
func UnregisterCallback(tagId int32) int32 {
ctagId, ctagIdAllocMap := (C.int32_t)(tagId), cgoAllocsUnknown
__ret := C.plc_tag_unregister_callback(ctagId)
runtime.KeepAlive(ctagIdAllocMap)
__v := (int32)(__ret)
return __v
}
// UnregisterLogger function as declared in include/libplctag.h:339
func UnregisterLogger() int32 {
__ret := C.plc_tag_unregister_logger()
__v := (int32)(__ret)
return __v
}
// Lock function as declared in include/libplctag.h:357
func Lock(tag int32) int32 {
ctag, ctagAllocMap := (C.int32_t)(tag), cgoAllocsUnknown
__ret := C.plc_tag_lock(ctag)
runtime.KeepAlive(ctagAllocMap)
__v := (int32)(__ret)
return __v
}
// Unlock function as declared in include/libplctag.h:368
func Unlock(tag int32) int32 {
ctag, ctagAllocMap := (C.int32_t)(tag), cgoAllocsUnknown
__ret := C.plc_tag_unlock(ctag)
runtime.KeepAlive(ctagAllocMap)
__v := (int32)(__ret)
return __v
}
// Abort function as declared in include/libplctag.h:386
func Abort(tag int32) int32 {
ctag, ctagAllocMap := (C.int32_t)(tag), cgoAllocsUnknown
__ret := C.plc_tag_abort(ctag)
runtime.KeepAlive(ctagAllocMap)
__v := (int32)(__ret)
return __v
}
// Destroy function as declared in include/libplctag.h:399
func Destroy(tag int32) int32 {
ctag, ctagAllocMap := (C.int32_t)(tag), cgoAllocsUnknown
__ret := C.plc_tag_destroy(ctag)
runtime.KeepAlive(ctagAllocMap)
__v := (int32)(__ret)
return __v
}
// Read function as declared in include/libplctag.h:416
func Read(tag int32, timeout int32) int32 {
ctag, ctagAllocMap := (C.int32_t)(tag), cgoAllocsUnknown
ctimeout, ctimeoutAllocMap := (C.int)(timeout), cgoAllocsUnknown
__ret := C.plc_tag_read(ctag, ctimeout)
runtime.KeepAlive(ctimeoutAllocMap)
runtime.KeepAlive(ctagAllocMap)
__v := (int32)(__ret)
return __v
}
// Status function as declared in include/libplctag.h:430
func Status(tag int32) int32 {
ctag, ctagAllocMap := (C.int32_t)(tag), cgoAllocsUnknown
__ret := C.plc_tag_status(ctag)
runtime.KeepAlive(ctagAllocMap)
__v := (int32)(__ret)
return __v
}
// Write function as declared in include/libplctag.h:448
func Write(tag int32, timeout int32) int32 {
ctag, ctagAllocMap := (C.int32_t)(tag), cgoAllocsUnknown
ctimeout, ctimeoutAllocMap := (C.int)(timeout), cgoAllocsUnknown
__ret := C.plc_tag_write(ctag, ctimeout)
runtime.KeepAlive(ctimeoutAllocMap)
runtime.KeepAlive(ctagAllocMap)
__v := (int32)(__ret)
return __v
}
// GetIntAttribute function as declared in include/libplctag.h:458
func GetIntAttribute(tag int32, attribName string, defaultValue int32) int32 {
ctag, ctagAllocMap := (C.int32_t)(tag), cgoAllocsUnknown
cattribName, cattribNameAllocMap := unpackPCharString(attribName)
cdefaultValue, cdefaultValueAllocMap := (C.int)(defaultValue), cgoAllocsUnknown
__ret := C.plc_tag_get_int_attribute(ctag, cattribName, cdefaultValue)
runtime.KeepAlive(cdefaultValueAllocMap)
runtime.KeepAlive(cattribNameAllocMap)
runtime.KeepAlive(ctagAllocMap)
__v := (int32)(__ret)
return __v
}
// SetIntAttribute function as declared in include/libplctag.h:459
func SetIntAttribute(tag int32, attribName string, newValue int32) int32 {
ctag, ctagAllocMap := (C.int32_t)(tag), cgoAllocsUnknown
cattribName, cattribNameAllocMap := unpackPCharString(attribName)
cnewValue, cnewValueAllocMap := (C.int)(newValue), cgoAllocsUnknown
__ret := C.plc_tag_set_int_attribute(ctag, cattribName, cnewValue)
runtime.KeepAlive(cnewValueAllocMap)
runtime.KeepAlive(cattribNameAllocMap)
runtime.KeepAlive(ctagAllocMap)
__v := (int32)(__ret)
return __v
}
// GetSize function as declared in include/libplctag.h:461
func GetSize(tag int32) int32 {
ctag, ctagAllocMap := (C.int32_t)(tag), cgoAllocsUnknown
__ret := C.plc_tag_get_size(ctag)
runtime.KeepAlive(ctagAllocMap)
__v := (int32)(__ret)
return __v
}
// SetSize function as declared in include/libplctag.h:463
func SetSize(tag int32, newSize int32) int32 {
ctag, ctagAllocMap := (C.int32_t)(tag), cgoAllocsUnknown
cnewSize, cnewSizeAllocMap := (C.int)(newSize), cgoAllocsUnknown
__ret := C.plc_tag_set_size(ctag, cnewSize)
runtime.KeepAlive(cnewSizeAllocMap)
runtime.KeepAlive(ctagAllocMap)
__v := (int32)(__ret)
return __v
}
// GetBit function as declared in include/libplctag.h:465
func GetBit(tag int32, offsetBit int32) int32 {
ctag, ctagAllocMap := (C.int32_t)(tag), cgoAllocsUnknown
coffsetBit, coffsetBitAllocMap := (C.int)(offsetBit), cgoAllocsUnknown
__ret := C.plc_tag_get_bit(ctag, coffsetBit)
runtime.KeepAlive(coffsetBitAllocMap)
runtime.KeepAlive(ctagAllocMap)
__v := (int32)(__ret)
return __v
}
// SetBit function as declared in include/libplctag.h:466
func SetBit(tag int32, offsetBit int32, val int32) int32 {
ctag, ctagAllocMap := (C.int32_t)(tag), cgoAllocsUnknown
coffsetBit, coffsetBitAllocMap := (C.int)(offsetBit), cgoAllocsUnknown
cval, cvalAllocMap := (C.int)(val), cgoAllocsUnknown
__ret := C.plc_tag_set_bit(ctag, coffsetBit, cval)
runtime.KeepAlive(cvalAllocMap)
runtime.KeepAlive(coffsetBitAllocMap)
runtime.KeepAlive(ctagAllocMap)
__v := (int32)(__ret)
return __v
}
// GetUint64 function as declared in include/libplctag.h:468
func GetUint64(tag int32, offset int32) uint32 {
ctag, ctagAllocMap := (C.int32_t)(tag), cgoAllocsUnknown
coffset, coffsetAllocMap := (C.int)(offset), cgoAllocsUnknown
__ret := C.plc_tag_get_uint64(ctag, coffset)
runtime.KeepAlive(coffsetAllocMap)
runtime.KeepAlive(ctagAllocMap)
__v := (uint32)(__ret)
return __v
}
// SetUint64 function as declared in include/libplctag.h:469
func SetUint64(tag int32, offset int32, val uint32) int32 {
ctag, ctagAllocMap := (C.int32_t)(tag), cgoAllocsUnknown
coffset, coffsetAllocMap := (C.int)(offset), cgoAllocsUnknown
cval, cvalAllocMap := (C.uint64_t)(val), cgoAllocsUnknown
__ret := C.plc_tag_set_uint64(ctag, coffset, cval)
runtime.KeepAlive(cvalAllocMap)
runtime.KeepAlive(coffsetAllocMap)
runtime.KeepAlive(ctagAllocMap)
__v := (int32)(__ret)
return __v
}
// GetInt64 function as declared in include/libplctag.h:471
func GetInt64(tag int32, offset int32) int32 {
ctag, ctagAllocMap := (C.int32_t)(tag), cgoAllocsUnknown
coffset, coffsetAllocMap := (C.int)(offset), cgoAllocsUnknown
__ret := C.plc_tag_get_int64(ctag, coffset)
runtime.KeepAlive(coffsetAllocMap)
runtime.KeepAlive(ctagAllocMap)
__v := (int32)(__ret)
return __v
}
// SetInt64 function as declared in include/libplctag.h:472
func SetInt64(arg0 int32, offset int32, val int32) int32 {
carg0, carg0AllocMap := (C.int32_t)(arg0), cgoAllocsUnknown
coffset, coffsetAllocMap := (C.int)(offset), cgoAllocsUnknown
cval, cvalAllocMap := (C.int64_t)(val), cgoAllocsUnknown
__ret := C.plc_tag_set_int64(carg0, coffset, cval)
runtime.KeepAlive(cvalAllocMap)
runtime.KeepAlive(coffsetAllocMap)
runtime.KeepAlive(carg0AllocMap)
__v := (int32)(__ret)
return __v
}
// GetUint32 function as declared in include/libplctag.h:475
func GetUint32(tag int32, offset int32) uint32 {
ctag, ctagAllocMap := (C.int32_t)(tag), cgoAllocsUnknown
coffset, coffsetAllocMap := (C.int)(offset), cgoAllocsUnknown
__ret := C.plc_tag_get_uint32(ctag, coffset)
runtime.KeepAlive(coffsetAllocMap)
runtime.KeepAlive(ctagAllocMap)
__v := (uint32)(__ret)
return __v
}
// SetUint32 function as declared in include/libplctag.h:476
func SetUint32(tag int32, offset int32, val uint32) int32 {
ctag, ctagAllocMap := (C.int32_t)(tag), cgoAllocsUnknown
coffset, coffsetAllocMap := (C.int)(offset), cgoAllocsUnknown
cval, cvalAllocMap := (C.uint32_t)(val), cgoAllocsUnknown
__ret := C.plc_tag_set_uint32(ctag, coffset, cval)
runtime.KeepAlive(cvalAllocMap)
runtime.KeepAlive(coffsetAllocMap)
runtime.KeepAlive(ctagAllocMap)
__v := (int32)(__ret)
return __v
}
// GetInt32 function as declared in include/libplctag.h:478
func GetInt32(tag int32, offset int32) int32 {
ctag, ctagAllocMap := (C.int32_t)(tag), cgoAllocsUnknown
coffset, coffsetAllocMap := (C.int)(offset), cgoAllocsUnknown
__ret := C.plc_tag_get_int32(ctag, coffset)
runtime.KeepAlive(coffsetAllocMap)
runtime.KeepAlive(ctagAllocMap)
__v := (int32)(__ret)
return __v
}
// SetInt32 function as declared in include/libplctag.h:479
func SetInt32(arg0 int32, offset int32, val int32) int32 {
carg0, carg0AllocMap := (C.int32_t)(arg0), cgoAllocsUnknown
coffset, coffsetAllocMap := (C.int)(offset), cgoAllocsUnknown
cval, cvalAllocMap := (C.int32_t)(val), cgoAllocsUnknown
__ret := C.plc_tag_set_int32(carg0, coffset, cval)
runtime.KeepAlive(cvalAllocMap)
runtime.KeepAlive(coffsetAllocMap)
runtime.KeepAlive(carg0AllocMap)
__v := (int32)(__ret)
return __v
}
// GetUint16 function as declared in include/libplctag.h:482
func GetUint16(tag int32, offset int32) uint16 {
ctag, ctagAllocMap := (C.int32_t)(tag), cgoAllocsUnknown
coffset, coffsetAllocMap := (C.int)(offset), cgoAllocsUnknown
__ret := C.plc_tag_get_uint16(ctag, coffset)
runtime.KeepAlive(coffsetAllocMap)
runtime.KeepAlive(ctagAllocMap)
__v := (uint16)(__ret)
return __v
}
// SetUint16 function as declared in include/libplctag.h:483
func SetUint16(tag int32, offset int32, val uint16) int32 {
ctag, ctagAllocMap := (C.int32_t)(tag), cgoAllocsUnknown
coffset, coffsetAllocMap := (C.int)(offset), cgoAllocsUnknown
cval, cvalAllocMap := (C.uint16_t)(val), cgoAllocsUnknown
__ret := C.plc_tag_set_uint16(ctag, coffset, cval)
runtime.KeepAlive(cvalAllocMap)
runtime.KeepAlive(coffsetAllocMap)
runtime.KeepAlive(ctagAllocMap)
__v := (int32)(__ret)
return __v
}
// GetInt16 function as declared in include/libplctag.h:485
func GetInt16(tag int32, offset int32) int16 {
ctag, ctagAllocMap := (C.int32_t)(tag), cgoAllocsUnknown
coffset, coffsetAllocMap := (C.int)(offset), cgoAllocsUnknown
__ret := C.plc_tag_get_int16(ctag, coffset)
runtime.KeepAlive(coffsetAllocMap)
runtime.KeepAlive(ctagAllocMap)
__v := (int16)(__ret)
return __v
}
// SetInt16 function as declared in include/libplctag.h:486
func SetInt16(arg0 int32, offset int32, val int16) int32 {
carg0, carg0AllocMap := (C.int32_t)(arg0), cgoAllocsUnknown
coffset, coffsetAllocMap := (C.int)(offset), cgoAllocsUnknown
cval, cvalAllocMap := (C.int16_t)(val), cgoAllocsUnknown
__ret := C.plc_tag_set_int16(carg0, coffset, cval)
runtime.KeepAlive(cvalAllocMap)
runtime.KeepAlive(coffsetAllocMap)
runtime.KeepAlive(carg0AllocMap)
__v := (int32)(__ret)
return __v
}
// GetUint8 function as declared in include/libplctag.h:489
func GetUint8(tag int32, offset int32) byte {
ctag, ctagAllocMap := (C.int32_t)(tag), cgoAllocsUnknown
coffset, coffsetAllocMap := (C.int)(offset), cgoAllocsUnknown
__ret := C.plc_tag_get_uint8(ctag, coffset)
runtime.KeepAlive(coffsetAllocMap)
runtime.KeepAlive(ctagAllocMap)
__v := (byte)(__ret)
return __v
}
// SetUint8 function as declared in include/libplctag.h:490
func SetUint8(tag int32, offset int32, val byte) int32 {
ctag, ctagAllocMap := (C.int32_t)(tag), cgoAllocsUnknown
coffset, coffsetAllocMap := (C.int)(offset), cgoAllocsUnknown
cval, cvalAllocMap := (C.uint8_t)(val), cgoAllocsUnknown
__ret := C.plc_tag_set_uint8(ctag, coffset, cval)
runtime.KeepAlive(cvalAllocMap)
runtime.KeepAlive(coffsetAllocMap)
runtime.KeepAlive(ctagAllocMap)
__v := (int32)(__ret)
return __v
}
// GetInt8 function as declared in include/libplctag.h:492
func GetInt8(tag int32, offset int32) int8 {
ctag, ctagAllocMap := (C.int32_t)(tag), cgoAllocsUnknown
coffset, coffsetAllocMap := (C.int)(offset), cgoAllocsUnknown
__ret := C.plc_tag_get_int8(ctag, coffset)
runtime.KeepAlive(coffsetAllocMap)
runtime.KeepAlive(ctagAllocMap)
__v := (int8)(__ret)
return __v
}
// SetInt8 function as declared in include/libplctag.h:493
func SetInt8(arg0 int32, offset int32, val int8) int32 {
carg0, carg0AllocMap := (C.int32_t)(arg0), cgoAllocsUnknown
coffset, coffsetAllocMap := (C.int)(offset), cgoAllocsUnknown
cval, cvalAllocMap := (C.int8_t)(val), cgoAllocsUnknown
__ret := C.plc_tag_set_int8(carg0, coffset, cval)
runtime.KeepAlive(cvalAllocMap)
runtime.KeepAlive(coffsetAllocMap)
runtime.KeepAlive(carg0AllocMap)
__v := (int32)(__ret)
return __v
}
// GetFloat64 function as declared in include/libplctag.h:496
func GetFloat64(tag int32, offset int32) float64 {
ctag, ctagAllocMap := (C.int32_t)(tag), cgoAllocsUnknown
coffset, coffsetAllocMap := (C.int)(offset), cgoAllocsUnknown
__ret := C.plc_tag_get_float64(ctag, coffset)
runtime.KeepAlive(coffsetAllocMap)
runtime.KeepAlive(ctagAllocMap)
__v := (float64)(__ret)
return __v
}
// SetFloat64 function as declared in include/libplctag.h:497
func SetFloat64(tag int32, offset int32, val float64) int32 {
ctag, ctagAllocMap := (C.int32_t)(tag), cgoAllocsUnknown
coffset, coffsetAllocMap := (C.int)(offset), cgoAllocsUnknown
cval, cvalAllocMap := (C.double)(val), cgoAllocsUnknown
__ret := C.plc_tag_set_float64(ctag, coffset, cval)
runtime.KeepAlive(cvalAllocMap)
runtime.KeepAlive(coffsetAllocMap)
runtime.KeepAlive(ctagAllocMap)
__v := (int32)(__ret)
return __v
}
// GetFloat32 function as declared in include/libplctag.h:499
func GetFloat32(tag int32, offset int32) float32 {
ctag, ctagAllocMap := (C.int32_t)(tag), cgoAllocsUnknown
coffset, coffsetAllocMap := (C.int)(offset), cgoAllocsUnknown
__ret := C.plc_tag_get_float32(ctag, coffset)
runtime.KeepAlive(coffsetAllocMap)
runtime.KeepAlive(ctagAllocMap)
__v := (float32)(__ret)
return __v
}
// SetFloat32 function as declared in include/libplctag.h:500
func SetFloat32(tag int32, offset int32, val float32) int32 {
ctag, ctagAllocMap := (C.int32_t)(tag), cgoAllocsUnknown
coffset, coffsetAllocMap := (C.int)(offset), cgoAllocsUnknown
cval, cvalAllocMap := (C.float)(val), cgoAllocsUnknown
__ret := C.plc_tag_set_float32(ctag, coffset, cval)
runtime.KeepAlive(cvalAllocMap)
runtime.KeepAlive(coffsetAllocMap)
runtime.KeepAlive(ctagAllocMap)
__v := (int32)(__ret)
return __v
}
// SetRawBytes function as declared in include/libplctag.h:503
func SetRawBytes(id int32, offset int32, buffer []byte, bufferLength int32) int32 {
cid, cidAllocMap := (C.int32_t)(id), cgoAllocsUnknown
coffset, coffsetAllocMap := (C.int)(offset), cgoAllocsUnknown
cbuffer, cbufferAllocMap := copyPUint8Bytes((*sliceHeader)(unsafe.Pointer(&buffer)))
cbufferLength, cbufferLengthAllocMap := (C.int)(bufferLength), cgoAllocsUnknown
__ret := C.plc_tag_set_raw_bytes(cid, coffset, cbuffer, cbufferLength)
runtime.KeepAlive(cbufferLengthAllocMap)
runtime.KeepAlive(cbufferAllocMap)
runtime.KeepAlive(coffsetAllocMap)
runtime.KeepAlive(cidAllocMap)
__v := (int32)(__ret)
return __v
}
// GetRawBytes function as declared in include/libplctag.h:504
func GetRawBytes(id int32, offset int32, buffer []byte, bufferLength int32) int32 {
cid, cidAllocMap := (C.int32_t)(id), cgoAllocsUnknown
coffset, coffsetAllocMap := (C.int)(offset), cgoAllocsUnknown
cbuffer, cbufferAllocMap := copyPUint8Bytes((*sliceHeader)(unsafe.Pointer(&buffer)))
cbufferLength, cbufferLengthAllocMap := (C.int)(bufferLength), cgoAllocsUnknown
__ret := C.plc_tag_get_raw_bytes(cid, coffset, cbuffer, cbufferLength)
runtime.KeepAlive(cbufferLengthAllocMap)
runtime.KeepAlive(cbufferAllocMap)
runtime.KeepAlive(coffsetAllocMap)
runtime.KeepAlive(cidAllocMap)
__v := (int32)(__ret)
return __v
}
// GetString function as declared in include/libplctag.h:508
func GetString(tagId int32, stringStartOffset int32, buffer []byte, bufferLength int32) int32 {
ctagId, ctagIdAllocMap := (C.int32_t)(tagId), cgoAllocsUnknown
cstringStartOffset, cstringStartOffsetAllocMap := (C.int)(stringStartOffset), cgoAllocsUnknown
cbuffer, cbufferAllocMap := copyPCharBytes((*sliceHeader)(unsafe.Pointer(&buffer)))
cbufferLength, cbufferLengthAllocMap := (C.int)(bufferLength), cgoAllocsUnknown
__ret := C.plc_tag_get_string(ctagId, cstringStartOffset, cbuffer, cbufferLength)
runtime.KeepAlive(cbufferLengthAllocMap)
runtime.KeepAlive(cbufferAllocMap)
runtime.KeepAlive(cstringStartOffsetAllocMap)
runtime.KeepAlive(ctagIdAllocMap)
__v := (int32)(__ret)
return __v
}
// SetString function as declared in include/libplctag.h:509
func SetString(tagId int32, stringStartOffset int32, stringVal string) int32 {
ctagId, ctagIdAllocMap := (C.int32_t)(tagId), cgoAllocsUnknown
cstringStartOffset, cstringStartOffsetAllocMap := (C.int)(stringStartOffset), cgoAllocsUnknown
cstringVal, cstringValAllocMap := unpackPCharString(stringVal)
__ret := C.plc_tag_set_string(ctagId, cstringStartOffset, cstringVal)
runtime.KeepAlive(cstringValAllocMap)
runtime.KeepAlive(cstringStartOffsetAllocMap)
runtime.KeepAlive(ctagIdAllocMap)
__v := (int32)(__ret)
return __v
}
// GetStringLength function as declared in include/libplctag.h:510
func GetStringLength(tagId int32, stringStartOffset int32) int32 {
ctagId, ctagIdAllocMap := (C.int32_t)(tagId), cgoAllocsUnknown
cstringStartOffset, cstringStartOffsetAllocMap := (C.int)(stringStartOffset), cgoAllocsUnknown
__ret := C.plc_tag_get_string_length(ctagId, cstringStartOffset)
runtime.KeepAlive(cstringStartOffsetAllocMap)
runtime.KeepAlive(ctagIdAllocMap)
__v := (int32)(__ret)
return __v
}
// GetStringCapacity function as declared in include/libplctag.h:511
func GetStringCapacity(tagId int32, stringStartOffset int32) int32 {
ctagId, ctagIdAllocMap := (C.int32_t)(tagId), cgoAllocsUnknown
cstringStartOffset, cstringStartOffsetAllocMap := (C.int)(stringStartOffset), cgoAllocsUnknown
__ret := C.plc_tag_get_string_capacity(ctagId, cstringStartOffset)
runtime.KeepAlive(cstringStartOffsetAllocMap)
runtime.KeepAlive(ctagIdAllocMap)
__v := (int32)(__ret)
return __v
}
// GetStringTotalLength function as declared in include/libplctag.h:512
func GetStringTotalLength(tagId int32, stringStartOffset int32) int32 {
ctagId, ctagIdAllocMap := (C.int32_t)(tagId), cgoAllocsUnknown
cstringStartOffset, cstringStartOffsetAllocMap := (C.int)(stringStartOffset), cgoAllocsUnknown
__ret := C.plc_tag_get_string_total_length(ctagId, cstringStartOffset)
runtime.KeepAlive(cstringStartOffsetAllocMap)
runtime.KeepAlive(ctagIdAllocMap)
__v := (int32)(__ret)
return __v
}
// CreateEx function as declared in goplctag/callbacks.h:33
func CreateEx(attribStr string, callbackFunction CreateExCallback, userdata unsafe.Pointer, timeout int32) int32 {
cattribStr, cattribStrAllocMap := unpackPCharString(attribStr)
ccallbackFunction, ccallbackFunctionAllocMap := callbackFunction.PassValue()
cuserdata, cuserdataAllocMap := userdata, cgoAllocsUnknown
ctimeout, ctimeoutAllocMap := (C.int)(timeout), cgoAllocsUnknown
__ret := C.go_plc_tag_create_ex(cattribStr, ccallbackFunction, cuserdata, ctimeout)
runtime.KeepAlive(ctimeoutAllocMap)
runtime.KeepAlive(cuserdataAllocMap)
runtime.KeepAlive(ccallbackFunctionAllocMap)
runtime.KeepAlive(cattribStrAllocMap)
__v := (int32)(__ret)
return __v
}
// RegisterCallbackEx function as declared in goplctag/callbacks.h:37
func RegisterCallbackEx(tagId int32, callbackFunction RegisterExCallback, userdata unsafe.Pointer) int32 {
ctagId, ctagIdAllocMap := (C.int32_t)(tagId), cgoAllocsUnknown
ccallbackFunction, ccallbackFunctionAllocMap := callbackFunction.PassValue()
cuserdata, cuserdataAllocMap := userdata, cgoAllocsUnknown
__ret := C.go_plc_tag_register_callback_ex(ctagId, ccallbackFunction, cuserdata)
runtime.KeepAlive(cuserdataAllocMap)
runtime.KeepAlive(ccallbackFunctionAllocMap)
runtime.KeepAlive(ctagIdAllocMap)
__v := (int32)(__ret)
return __v
}
// RegisterLogger function as declared in goplctag/callbacks.h:41
func RegisterLogger(callbackFunction RegisterLoggerCallback) int32 {
ccallbackFunction, ccallbackFunctionAllocMap := callbackFunction.PassValue()
__ret := C.go_plc_tag_register_logger(ccallbackFunction)
runtime.KeepAlive(ccallbackFunctionAllocMap)
__v := (int32)(__ret)
return __v
}