An mbed implementation of IEC 61850-9-2LE Sample Values. Creating using the rapid61850 library, available at: https://github.com/stevenblair/rapid61850.

Dependencies:   mbed

An mbed implementation of IEC 61850-9-2LE Sample Values. Creating using the rapid61850 library, available at: https://github.com/stevenblair/rapid61850.

Committer:
sblair
Date:
Tue Oct 02 21:31:05 2012 +0000
Revision:
0:f09b7bb8bcce
converted library to folder

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sblair 0:f09b7bb8bcce 1 /**
sblair 0:f09b7bb8bcce 2 * Rapid-prototyping protection schemes with IEC 61850
sblair 0:f09b7bb8bcce 3 *
sblair 0:f09b7bb8bcce 4 * Copyright (c) 2012 Steven Blair
sblair 0:f09b7bb8bcce 5 *
sblair 0:f09b7bb8bcce 6 * This program is free software; you can redistribute it and/or
sblair 0:f09b7bb8bcce 7 * modify it under the terms of the GNU General Public License
sblair 0:f09b7bb8bcce 8 * as published by the Free Software Foundation; either version 2
sblair 0:f09b7bb8bcce 9 * of the License, or (at your option) any later version.
sblair 0:f09b7bb8bcce 10
sblair 0:f09b7bb8bcce 11 * This program is distributed in the hope that it will be useful,
sblair 0:f09b7bb8bcce 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
sblair 0:f09b7bb8bcce 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
sblair 0:f09b7bb8bcce 14 * GNU General Public License for more details.
sblair 0:f09b7bb8bcce 15
sblair 0:f09b7bb8bcce 16 * You should have received a copy of the GNU General Public License
sblair 0:f09b7bb8bcce 17 * along with this program; if not, write to the Free Software
sblair 0:f09b7bb8bcce 18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
sblair 0:f09b7bb8bcce 19 */
sblair 0:f09b7bb8bcce 20
sblair 0:f09b7bb8bcce 21 #include "gseEncodeBasic.h"
sblair 0:f09b7bb8bcce 22 #include "ied.h"
sblair 0:f09b7bb8bcce 23 #include "gseEncode.h"
sblair 0:f09b7bb8bcce 24
sblair 0:f09b7bb8bcce 25
sblair 0:f09b7bb8bcce 26
sblair 0:f09b7bb8bcce 27
sblair 0:f09b7bb8bcce 28 int ber_get_length_IEC_61850_9_2LEAV(struct IEC_61850_9_2LEAV *IEC_61850_9_2LEAV) {
sblair 0:f09b7bb8bcce 29 int total = 0;
sblair 0:f09b7bb8bcce 30 int len = 0;
sblair 0:f09b7bb8bcce 31
sblair 0:f09b7bb8bcce 32 len = BER_GET_LENGTH_CTYPE_INT32(&IEC_61850_9_2LEAV->i);
sblair 0:f09b7bb8bcce 33 total += len + getLengthBytes(len) + 1;
sblair 0:f09b7bb8bcce 34
sblair 0:f09b7bb8bcce 35 return total;
sblair 0:f09b7bb8bcce 36 }
sblair 0:f09b7bb8bcce 37 int ber_encode_IEC_61850_9_2LEAV(unsigned char *buf, struct IEC_61850_9_2LEAV *IEC_61850_9_2LEAV) {
sblair 0:f09b7bb8bcce 38 int offset = 0;
sblair 0:f09b7bb8bcce 39
sblair 0:f09b7bb8bcce 40 buf[offset++] = 0xA2;
sblair 0:f09b7bb8bcce 41 offset += encodeLength(&buf[offset], ber_get_length_IEC_61850_9_2LEAV(IEC_61850_9_2LEAV));
sblair 0:f09b7bb8bcce 42
sblair 0:f09b7bb8bcce 43 offset += BER_ENCODE_CTYPE_INT32(&buf[offset], &IEC_61850_9_2LEAV->i);
sblair 0:f09b7bb8bcce 44
sblair 0:f09b7bb8bcce 45 return offset;
sblair 0:f09b7bb8bcce 46 }
sblair 0:f09b7bb8bcce 47 int ber_get_length_IEC_61850_9_2LEsVCAmp(struct IEC_61850_9_2LEsVCAmp *IEC_61850_9_2LEsVCAmp) {
sblair 0:f09b7bb8bcce 48 int total = 0;
sblair 0:f09b7bb8bcce 49 int len = 0;
sblair 0:f09b7bb8bcce 50
sblair 0:f09b7bb8bcce 51 len = BER_GET_LENGTH_CTYPE_FLOAT32(&IEC_61850_9_2LEsVCAmp->scaleFactor);
sblair 0:f09b7bb8bcce 52 total += len + getLengthBytes(len) + 1;
sblair 0:f09b7bb8bcce 53 len = BER_GET_LENGTH_CTYPE_FLOAT32(&IEC_61850_9_2LEsVCAmp->offset);
sblair 0:f09b7bb8bcce 54 total += len + getLengthBytes(len) + 1;
sblair 0:f09b7bb8bcce 55
sblair 0:f09b7bb8bcce 56 return total;
sblair 0:f09b7bb8bcce 57 }
sblair 0:f09b7bb8bcce 58 int ber_encode_IEC_61850_9_2LEsVCAmp(unsigned char *buf, struct IEC_61850_9_2LEsVCAmp *IEC_61850_9_2LEsVCAmp) {
sblair 0:f09b7bb8bcce 59 int offset = 0;
sblair 0:f09b7bb8bcce 60
sblair 0:f09b7bb8bcce 61 buf[offset++] = 0xA2;
sblair 0:f09b7bb8bcce 62 offset += encodeLength(&buf[offset], ber_get_length_IEC_61850_9_2LEsVCAmp(IEC_61850_9_2LEsVCAmp));
sblair 0:f09b7bb8bcce 63
sblair 0:f09b7bb8bcce 64 offset += BER_ENCODE_CTYPE_FLOAT32(&buf[offset], &IEC_61850_9_2LEsVCAmp->scaleFactor);
sblair 0:f09b7bb8bcce 65 offset += BER_ENCODE_CTYPE_FLOAT32(&buf[offset], &IEC_61850_9_2LEsVCAmp->offset);
sblair 0:f09b7bb8bcce 66
sblair 0:f09b7bb8bcce 67 return offset;
sblair 0:f09b7bb8bcce 68 }
sblair 0:f09b7bb8bcce 69 int ber_get_length_IEC_61850_9_2LEsVCVol(struct IEC_61850_9_2LEsVCVol *IEC_61850_9_2LEsVCVol) {
sblair 0:f09b7bb8bcce 70 int total = 0;
sblair 0:f09b7bb8bcce 71 int len = 0;
sblair 0:f09b7bb8bcce 72
sblair 0:f09b7bb8bcce 73 len = BER_GET_LENGTH_CTYPE_FLOAT32(&IEC_61850_9_2LEsVCVol->scaleFactor);
sblair 0:f09b7bb8bcce 74 total += len + getLengthBytes(len) + 1;
sblair 0:f09b7bb8bcce 75 len = BER_GET_LENGTH_CTYPE_FLOAT32(&IEC_61850_9_2LEsVCVol->offset);
sblair 0:f09b7bb8bcce 76 total += len + getLengthBytes(len) + 1;
sblair 0:f09b7bb8bcce 77
sblair 0:f09b7bb8bcce 78 return total;
sblair 0:f09b7bb8bcce 79 }
sblair 0:f09b7bb8bcce 80 int ber_encode_IEC_61850_9_2LEsVCVol(unsigned char *buf, struct IEC_61850_9_2LEsVCVol *IEC_61850_9_2LEsVCVol) {
sblair 0:f09b7bb8bcce 81 int offset = 0;
sblair 0:f09b7bb8bcce 82
sblair 0:f09b7bb8bcce 83 buf[offset++] = 0xA2;
sblair 0:f09b7bb8bcce 84 offset += encodeLength(&buf[offset], ber_get_length_IEC_61850_9_2LEsVCVol(IEC_61850_9_2LEsVCVol));
sblair 0:f09b7bb8bcce 85
sblair 0:f09b7bb8bcce 86 offset += BER_ENCODE_CTYPE_FLOAT32(&buf[offset], &IEC_61850_9_2LEsVCVol->scaleFactor);
sblair 0:f09b7bb8bcce 87 offset += BER_ENCODE_CTYPE_FLOAT32(&buf[offset], &IEC_61850_9_2LEsVCVol->offset);
sblair 0:f09b7bb8bcce 88
sblair 0:f09b7bb8bcce 89 return offset;
sblair 0:f09b7bb8bcce 90 }
sblair 0:f09b7bb8bcce 91 int ber_get_length_IEC_61850_9_2LESAVAmp(struct IEC_61850_9_2LESAVAmp *IEC_61850_9_2LESAVAmp) {
sblair 0:f09b7bb8bcce 92 int total = 0;
sblair 0:f09b7bb8bcce 93 int len = 0;
sblair 0:f09b7bb8bcce 94
sblair 0:f09b7bb8bcce 95 len = ber_get_length_IEC_61850_9_2LEAV(&IEC_61850_9_2LESAVAmp->instMag);
sblair 0:f09b7bb8bcce 96 total += len + getLengthBytes(len) + 1;
sblair 0:f09b7bb8bcce 97 len = BER_GET_LENGTH_CTYPE_QUALITY(&IEC_61850_9_2LESAVAmp->q);
sblair 0:f09b7bb8bcce 98 total += len + getLengthBytes(len) + 1;
sblair 0:f09b7bb8bcce 99 len = ber_get_length_IEC_61850_9_2LEsVCAmp(&IEC_61850_9_2LESAVAmp->sVC);
sblair 0:f09b7bb8bcce 100 total += len + getLengthBytes(len) + 1;
sblair 0:f09b7bb8bcce 101
sblair 0:f09b7bb8bcce 102 return total;
sblair 0:f09b7bb8bcce 103 }
sblair 0:f09b7bb8bcce 104 int ber_encode_IEC_61850_9_2LESAVAmp(unsigned char *buf, struct IEC_61850_9_2LESAVAmp *IEC_61850_9_2LESAVAmp) {
sblair 0:f09b7bb8bcce 105 int offset = 0;
sblair 0:f09b7bb8bcce 106
sblair 0:f09b7bb8bcce 107 buf[offset++] = 0xA2;
sblair 0:f09b7bb8bcce 108 offset += encodeLength(&buf[offset], ber_get_length_IEC_61850_9_2LESAVAmp(IEC_61850_9_2LESAVAmp));
sblair 0:f09b7bb8bcce 109
sblair 0:f09b7bb8bcce 110 offset += ber_encode_IEC_61850_9_2LEAV(&buf[offset], &IEC_61850_9_2LESAVAmp->instMag);
sblair 0:f09b7bb8bcce 111 offset += BER_ENCODE_CTYPE_QUALITY(&buf[offset], &IEC_61850_9_2LESAVAmp->q);
sblair 0:f09b7bb8bcce 112 offset += ber_encode_IEC_61850_9_2LEsVCAmp(&buf[offset], &IEC_61850_9_2LESAVAmp->sVC);
sblair 0:f09b7bb8bcce 113
sblair 0:f09b7bb8bcce 114 return offset;
sblair 0:f09b7bb8bcce 115 }
sblair 0:f09b7bb8bcce 116 int ber_get_length_IEC_61850_9_2LESAVVol(struct IEC_61850_9_2LESAVVol *IEC_61850_9_2LESAVVol) {
sblair 0:f09b7bb8bcce 117 int total = 0;
sblair 0:f09b7bb8bcce 118 int len = 0;
sblair 0:f09b7bb8bcce 119
sblair 0:f09b7bb8bcce 120 len = ber_get_length_IEC_61850_9_2LEAV(&IEC_61850_9_2LESAVVol->instMag);
sblair 0:f09b7bb8bcce 121 total += len + getLengthBytes(len) + 1;
sblair 0:f09b7bb8bcce 122 len = BER_GET_LENGTH_CTYPE_QUALITY(&IEC_61850_9_2LESAVVol->q);
sblair 0:f09b7bb8bcce 123 total += len + getLengthBytes(len) + 1;
sblair 0:f09b7bb8bcce 124 len = ber_get_length_IEC_61850_9_2LEsVCVol(&IEC_61850_9_2LESAVVol->sVC);
sblair 0:f09b7bb8bcce 125 total += len + getLengthBytes(len) + 1;
sblair 0:f09b7bb8bcce 126
sblair 0:f09b7bb8bcce 127 return total;
sblair 0:f09b7bb8bcce 128 }
sblair 0:f09b7bb8bcce 129 int ber_encode_IEC_61850_9_2LESAVVol(unsigned char *buf, struct IEC_61850_9_2LESAVVol *IEC_61850_9_2LESAVVol) {
sblair 0:f09b7bb8bcce 130 int offset = 0;
sblair 0:f09b7bb8bcce 131
sblair 0:f09b7bb8bcce 132 buf[offset++] = 0xA2;
sblair 0:f09b7bb8bcce 133 offset += encodeLength(&buf[offset], ber_get_length_IEC_61850_9_2LESAVVol(IEC_61850_9_2LESAVVol));
sblair 0:f09b7bb8bcce 134
sblair 0:f09b7bb8bcce 135 offset += ber_encode_IEC_61850_9_2LEAV(&buf[offset], &IEC_61850_9_2LESAVVol->instMag);
sblair 0:f09b7bb8bcce 136 offset += BER_ENCODE_CTYPE_QUALITY(&buf[offset], &IEC_61850_9_2LESAVVol->q);
sblair 0:f09b7bb8bcce 137 offset += ber_encode_IEC_61850_9_2LEsVCVol(&buf[offset], &IEC_61850_9_2LESAVVol->sVC);
sblair 0:f09b7bb8bcce 138
sblair 0:f09b7bb8bcce 139 return offset;
sblair 0:f09b7bb8bcce 140 }
sblair 0:f09b7bb8bcce 141 int ber_get_length_IEC_61850_9_2LEINC(struct IEC_61850_9_2LEINC *IEC_61850_9_2LEINC) {
sblair 0:f09b7bb8bcce 142 int total = 0;
sblair 0:f09b7bb8bcce 143 int len = 0;
sblair 0:f09b7bb8bcce 144
sblair 0:f09b7bb8bcce 145 len = BER_GET_LENGTH_CTYPE_INT32(&IEC_61850_9_2LEINC->ctlVal);
sblair 0:f09b7bb8bcce 146 total += len + getLengthBytes(len) + 1;
sblair 0:f09b7bb8bcce 147 len = BER_GET_LENGTH_CTYPE_INT32(&IEC_61850_9_2LEINC->stVal);
sblair 0:f09b7bb8bcce 148 total += len + getLengthBytes(len) + 1;
sblair 0:f09b7bb8bcce 149 len = BER_GET_LENGTH_CTYPE_QUALITY(&IEC_61850_9_2LEINC->q);
sblair 0:f09b7bb8bcce 150 total += len + getLengthBytes(len) + 1;
sblair 0:f09b7bb8bcce 151 len = BER_GET_LENGTH_CTYPE_TIMESTAMP(&IEC_61850_9_2LEINC->t);
sblair 0:f09b7bb8bcce 152 total += len + getLengthBytes(len) + 1;
sblair 0:f09b7bb8bcce 153
sblair 0:f09b7bb8bcce 154 return total;
sblair 0:f09b7bb8bcce 155 }
sblair 0:f09b7bb8bcce 156 int ber_encode_IEC_61850_9_2LEINC(unsigned char *buf, struct IEC_61850_9_2LEINC *IEC_61850_9_2LEINC) {
sblair 0:f09b7bb8bcce 157 int offset = 0;
sblair 0:f09b7bb8bcce 158
sblair 0:f09b7bb8bcce 159 buf[offset++] = 0xA2;
sblair 0:f09b7bb8bcce 160 offset += encodeLength(&buf[offset], ber_get_length_IEC_61850_9_2LEINC(IEC_61850_9_2LEINC));
sblair 0:f09b7bb8bcce 161
sblair 0:f09b7bb8bcce 162 offset += BER_ENCODE_CTYPE_INT32(&buf[offset], &IEC_61850_9_2LEINC->ctlVal);
sblair 0:f09b7bb8bcce 163 offset += BER_ENCODE_CTYPE_INT32(&buf[offset], &IEC_61850_9_2LEINC->stVal);
sblair 0:f09b7bb8bcce 164 offset += BER_ENCODE_CTYPE_QUALITY(&buf[offset], &IEC_61850_9_2LEINC->q);
sblair 0:f09b7bb8bcce 165 offset += BER_ENCODE_CTYPE_TIMESTAMP(&buf[offset], &IEC_61850_9_2LEINC->t);
sblair 0:f09b7bb8bcce 166
sblair 0:f09b7bb8bcce 167 return offset;
sblair 0:f09b7bb8bcce 168 }
sblair 0:f09b7bb8bcce 169 int ber_get_length_LE_IED_MUnn_PhsMeas1() {
sblair 0:f09b7bb8bcce 170 int total = 0;
sblair 0:f09b7bb8bcce 171 int len = 0;
sblair 0:f09b7bb8bcce 172
sblair 0:f09b7bb8bcce 173 len = ber_get_length_IEC_61850_9_2LEAV(&LE_IED.S1.MUnn.IEC_61850_9_2LETCTR_1.Amp.instMag);
sblair 0:f09b7bb8bcce 174 total += len + getLengthBytes(len) + 1;
sblair 0:f09b7bb8bcce 175 len = BER_GET_LENGTH_CTYPE_QUALITY(&LE_IED.S1.MUnn.IEC_61850_9_2LETCTR_1.Amp.q);
sblair 0:f09b7bb8bcce 176 total += len + getLengthBytes(len) + 1;
sblair 0:f09b7bb8bcce 177 len = ber_get_length_IEC_61850_9_2LEAV(&LE_IED.S1.MUnn.IEC_61850_9_2LETCTR_2.Amp.instMag);
sblair 0:f09b7bb8bcce 178 total += len + getLengthBytes(len) + 1;
sblair 0:f09b7bb8bcce 179 len = BER_GET_LENGTH_CTYPE_QUALITY(&LE_IED.S1.MUnn.IEC_61850_9_2LETCTR_2.Amp.q);
sblair 0:f09b7bb8bcce 180 total += len + getLengthBytes(len) + 1;
sblair 0:f09b7bb8bcce 181 len = ber_get_length_IEC_61850_9_2LEAV(&LE_IED.S1.MUnn.IEC_61850_9_2LETCTR_3.Amp.instMag);
sblair 0:f09b7bb8bcce 182 total += len + getLengthBytes(len) + 1;
sblair 0:f09b7bb8bcce 183 len = BER_GET_LENGTH_CTYPE_QUALITY(&LE_IED.S1.MUnn.IEC_61850_9_2LETCTR_3.Amp.q);
sblair 0:f09b7bb8bcce 184 total += len + getLengthBytes(len) + 1;
sblair 0:f09b7bb8bcce 185 len = ber_get_length_IEC_61850_9_2LEAV(&LE_IED.S1.MUnn.IEC_61850_9_2LETCTR_4.Amp.instMag);
sblair 0:f09b7bb8bcce 186 total += len + getLengthBytes(len) + 1;
sblair 0:f09b7bb8bcce 187 len = BER_GET_LENGTH_CTYPE_QUALITY(&LE_IED.S1.MUnn.IEC_61850_9_2LETCTR_4.Amp.q);
sblair 0:f09b7bb8bcce 188 total += len + getLengthBytes(len) + 1;
sblair 0:f09b7bb8bcce 189 len = ber_get_length_IEC_61850_9_2LEAV(&LE_IED.S1.MUnn.IEC_61850_9_2LETVTR_1.Vol.instMag);
sblair 0:f09b7bb8bcce 190 total += len + getLengthBytes(len) + 1;
sblair 0:f09b7bb8bcce 191 len = BER_GET_LENGTH_CTYPE_QUALITY(&LE_IED.S1.MUnn.IEC_61850_9_2LETVTR_1.Vol.q);
sblair 0:f09b7bb8bcce 192 total += len + getLengthBytes(len) + 1;
sblair 0:f09b7bb8bcce 193 len = ber_get_length_IEC_61850_9_2LEAV(&LE_IED.S1.MUnn.IEC_61850_9_2LETVTR_2.Vol.instMag);
sblair 0:f09b7bb8bcce 194 total += len + getLengthBytes(len) + 1;
sblair 0:f09b7bb8bcce 195 len = BER_GET_LENGTH_CTYPE_QUALITY(&LE_IED.S1.MUnn.IEC_61850_9_2LETVTR_2.Vol.q);
sblair 0:f09b7bb8bcce 196 total += len + getLengthBytes(len) + 1;
sblair 0:f09b7bb8bcce 197 len = ber_get_length_IEC_61850_9_2LEAV(&LE_IED.S1.MUnn.IEC_61850_9_2LETVTR_3.Vol.instMag);
sblair 0:f09b7bb8bcce 198 total += len + getLengthBytes(len) + 1;
sblair 0:f09b7bb8bcce 199 len = BER_GET_LENGTH_CTYPE_QUALITY(&LE_IED.S1.MUnn.IEC_61850_9_2LETVTR_3.Vol.q);
sblair 0:f09b7bb8bcce 200 total += len + getLengthBytes(len) + 1;
sblair 0:f09b7bb8bcce 201 len = ber_get_length_IEC_61850_9_2LEAV(&LE_IED.S1.MUnn.IEC_61850_9_2LETVTR_4.Vol.instMag);
sblair 0:f09b7bb8bcce 202 total += len + getLengthBytes(len) + 1;
sblair 0:f09b7bb8bcce 203 len = BER_GET_LENGTH_CTYPE_QUALITY(&LE_IED.S1.MUnn.IEC_61850_9_2LETVTR_4.Vol.q);
sblair 0:f09b7bb8bcce 204 total += len + getLengthBytes(len) + 1;
sblair 0:f09b7bb8bcce 205
sblair 0:f09b7bb8bcce 206 return total;
sblair 0:f09b7bb8bcce 207 }
sblair 0:f09b7bb8bcce 208 int ber_encode_LE_IED_MUnn_PhsMeas1(unsigned char *buf) {
sblair 0:f09b7bb8bcce 209 int offset = 0;
sblair 0:f09b7bb8bcce 210
sblair 0:f09b7bb8bcce 211 offset += ber_encode_IEC_61850_9_2LEAV(&buf[offset], &LE_IED.S1.MUnn.IEC_61850_9_2LETCTR_1.Amp.instMag);
sblair 0:f09b7bb8bcce 212 offset += BER_ENCODE_CTYPE_QUALITY(&buf[offset], &LE_IED.S1.MUnn.IEC_61850_9_2LETCTR_1.Amp.q);
sblair 0:f09b7bb8bcce 213 offset += ber_encode_IEC_61850_9_2LEAV(&buf[offset], &LE_IED.S1.MUnn.IEC_61850_9_2LETCTR_2.Amp.instMag);
sblair 0:f09b7bb8bcce 214 offset += BER_ENCODE_CTYPE_QUALITY(&buf[offset], &LE_IED.S1.MUnn.IEC_61850_9_2LETCTR_2.Amp.q);
sblair 0:f09b7bb8bcce 215 offset += ber_encode_IEC_61850_9_2LEAV(&buf[offset], &LE_IED.S1.MUnn.IEC_61850_9_2LETCTR_3.Amp.instMag);
sblair 0:f09b7bb8bcce 216 offset += BER_ENCODE_CTYPE_QUALITY(&buf[offset], &LE_IED.S1.MUnn.IEC_61850_9_2LETCTR_3.Amp.q);
sblair 0:f09b7bb8bcce 217 offset += ber_encode_IEC_61850_9_2LEAV(&buf[offset], &LE_IED.S1.MUnn.IEC_61850_9_2LETCTR_4.Amp.instMag);
sblair 0:f09b7bb8bcce 218 offset += BER_ENCODE_CTYPE_QUALITY(&buf[offset], &LE_IED.S1.MUnn.IEC_61850_9_2LETCTR_4.Amp.q);
sblair 0:f09b7bb8bcce 219 offset += ber_encode_IEC_61850_9_2LEAV(&buf[offset], &LE_IED.S1.MUnn.IEC_61850_9_2LETVTR_1.Vol.instMag);
sblair 0:f09b7bb8bcce 220 offset += BER_ENCODE_CTYPE_QUALITY(&buf[offset], &LE_IED.S1.MUnn.IEC_61850_9_2LETVTR_1.Vol.q);
sblair 0:f09b7bb8bcce 221 offset += ber_encode_IEC_61850_9_2LEAV(&buf[offset], &LE_IED.S1.MUnn.IEC_61850_9_2LETVTR_2.Vol.instMag);
sblair 0:f09b7bb8bcce 222 offset += BER_ENCODE_CTYPE_QUALITY(&buf[offset], &LE_IED.S1.MUnn.IEC_61850_9_2LETVTR_2.Vol.q);
sblair 0:f09b7bb8bcce 223 offset += ber_encode_IEC_61850_9_2LEAV(&buf[offset], &LE_IED.S1.MUnn.IEC_61850_9_2LETVTR_3.Vol.instMag);
sblair 0:f09b7bb8bcce 224 offset += BER_ENCODE_CTYPE_QUALITY(&buf[offset], &LE_IED.S1.MUnn.IEC_61850_9_2LETVTR_3.Vol.q);
sblair 0:f09b7bb8bcce 225 offset += ber_encode_IEC_61850_9_2LEAV(&buf[offset], &LE_IED.S1.MUnn.IEC_61850_9_2LETVTR_4.Vol.instMag);
sblair 0:f09b7bb8bcce 226 offset += BER_ENCODE_CTYPE_QUALITY(&buf[offset], &LE_IED.S1.MUnn.IEC_61850_9_2LETVTR_4.Vol.q);
sblair 0:f09b7bb8bcce 227
sblair 0:f09b7bb8bcce 228 return offset;
sblair 0:f09b7bb8bcce 229 }
sblair 0:f09b7bb8bcce 230
sblair 0:f09b7bb8bcce 231