Przeglądaj źródła

MBIC GUI 변경사항
- FRBT 상태 프로토콜 추가
- CPU Version 값 추가
- BootLoader Length -> Frame 형식으로 변경
- 제조일자 추가할 수 있는 UI 추가
- PCB Version
- Serial Number 추가 할 수 있도록 추가

PYJ 5 lat temu
rodzic
commit
759ded956b

BIN
.vs/Jdas_Mbic/v15/.suo


BIN
.vs/Jdas_Mbic/v15/Server/sqlite3/storage.ide


BIN
.vs/Jdas_Mbic/v15/Server/sqlite3/storage.ide-shm


BIN
.vs/Jdas_Mbic/v15/Server/sqlite3/storage.ide-wal


+ 13 - 9
Jdas_Mbic/Func/Bluecell_BootProtocol.cs

@@ -154,6 +154,9 @@ namespace Jdas_Mbic
154
             Bluecell_TimeSetting,
154
             Bluecell_TimeSetting,
155
             Bluecell_Factory_Set,
155
             Bluecell_Factory_Set,
156
             Bluecell_CarrierOnOff,
156
             Bluecell_CarrierOnOff,
157
+            Bluecell_PCBVersionSet,
158
+            Bluecell_SerialNumberSet,
159
+            Bluecell_ManufactureDateSet,
157
         };
160
         };
158
 
161
 
159
        
162
        
@@ -218,13 +221,8 @@ namespace Jdas_Mbic
218
         {
221
         {
219
             byte[] ret = new byte[data.Length + 22 + 3];
222
             byte[] ret = new byte[data.Length + 22 + 3];
220
             UInt16 CRCData = 0;
223
             UInt16 CRCData = 0;
221
-         //   UInt16 CRCData = crc16.CRC16_Generate(data, data.Length);
222
-            /*
223
-             TAIL
224
-             */
225
-            ret[(int)MBICProt_st.MBIC_PAYLOADSTART + Length + 0] = Convert.ToByte((CRCData & 0xFF00) >> 8);
226
-            ret[(int)MBICProt_st.MBIC_PAYLOADSTART + Length + 1] = Convert.ToByte((CRCData & 0x00FF));
227
-            ret[(int)MBICProt_st.MBIC_PAYLOADSTART + Length + 2] = 0x03;
224
+            
225
+
228
             /*
226
             /*
229
              Header
227
              Header
230
              */
228
              */
@@ -260,9 +258,15 @@ namespace Jdas_Mbic
260
 
258
 
261
 
259
 
262
 
260
 
263
-            for (int i = 0; i < data.Length; i++)
261
+            for (int i = 0; i < Length; i++)
264
                 ret[(int)MBICProt_st.MBIC_PAYLOADSTART + i] = data[i];
262
                 ret[(int)MBICProt_st.MBIC_PAYLOADSTART + i] = data[i];
265
-
263
+            /*
264
+             TAIL
265
+             */
266
+           // CRCData = crc16.CRC16_Generate(data, Length);
267
+            ret[(int)MBICProt_st.MBIC_PAYLOADSTART + Length + 0] = Convert.ToByte((CRCData & 0xFF00) >> 8);
268
+            ret[(int)MBICProt_st.MBIC_PAYLOADSTART + Length + 1] = Convert.ToByte((CRCData & 0x00FF));
269
+            ret[(int)MBICProt_st.MBIC_PAYLOADSTART + Length + 2] = 0x03;
266
             return ret;
270
             return ret;
267
         }
271
         }
268
 
272
 

+ 34 - 3
Jdas_Mbic/Func/Crc16.cs

@@ -129,23 +129,54 @@ namespace Jdas_Mbic
129
             return dataret;
129
             return dataret;
130
         }
130
         }
131
 
131
 
132
-
133
         public bool CRC16_Check(byte[] buf_ptr, int len, UInt16 checksum)
132
         public bool CRC16_Check(byte[] buf_ptr, int len, UInt16 checksum)
134
         {
133
         {
135
             UInt16 crc = 0;
134
             UInt16 crc = 0;
136
             bool ret = false;
135
             bool ret = false;
137
             UInt16[] data = new UInt16[1024];
136
             UInt16[] data = new UInt16[1024];
138
-            
137
+
139
             for (UInt32 counter = 1; counter <= len; counter++)
138
             for (UInt32 counter = 1; counter <= len; counter++)
140
             {
139
             {
141
                 data[counter - 1] = crc = (UInt16)((crc << 8) ^ crc16_tab[(UInt32)(((crc >> 8) ^ buf_ptr[counter]) & 0x00FF)]);
140
                 data[counter - 1] = crc = (UInt16)((crc << 8) ^ crc16_tab[(UInt32)(((crc >> 8) ^ buf_ptr[counter]) & 0x00FF)]);
142
-                
141
+
142
+            }
143
+            if (crc == checksum)
144
+                ret = true;
145
+
146
+            return ret;
147
+        }
148
+        public UInt16 MBIC_CRC16_Generate(byte[] buf_ptr, int len)
149
+        {
150
+            UInt32 crc = 0;
151
+            for (UInt32 counter = 22; counter < len + 22; counter++)
152
+                crc = (UInt32)(((crc << 8) ^ crc16_tab[(UInt32)(((crc >> 8) ^ buf_ptr[counter]) & 0x00FF)]));
153
+            //    printf("len : %d \r\n",len);
154
+            return Convert.ToUInt16(crc & 0xFFFF);
155
+        }
156
+        public bool MBIC_CRC16_Check(byte[] buf_ptr, int len, UInt16 checksum)
157
+        {
158
+            UInt16 crc = 0;
159
+            bool ret = false;
160
+            UInt16[] data = new UInt16[1024];
161
+
162
+            for (UInt32 counter = 22; counter < len + 22; counter++)
163
+            {
164
+                data[counter - 22] = crc = (UInt16)((crc << 8) ^ crc16_tab[(UInt32)(((crc >> 8) ^ buf_ptr[counter]) & 0x00FF)]);
165
+
143
             }
166
             }
144
             if (crc == checksum)
167
             if (crc == checksum)
145
                 ret = true;
168
                 ret = true;
146
 
169
 
147
             return ret;
170
             return ret;
148
         }
171
         }
172
+        public UInt16 Download_CRC16_Generate(byte[] buf_ptr, int len)
173
+        {
174
+            UInt32 crc = 0;
175
+            for (UInt32 counter = 0; counter < len; counter++)
176
+                crc = (UInt32)(((crc << 8) ^ crc16_tab[(UInt32)(((crc >> 8) ^ buf_ptr[counter]) & 0x00FF)]));
177
+            //    printf("len : %d \r\n",len);
178
+            return Convert.ToUInt16(crc & 0xFFFF);
179
+        }
149
         public UInt16 CRC16_Generate(byte[] buf_ptr, int len)
180
         public UInt16 CRC16_Generate(byte[] buf_ptr, int len)
150
         {
181
         {
151
             UInt32 crc = 0;
182
             UInt32 crc = 0;

+ 39 - 47
Jdas_Mbic/Func/Data_Handler.cs

@@ -21,7 +21,7 @@ namespace Jdas_Mbic
21
             MBIC_Notice_REQ = 0x10,
21
             MBIC_Notice_REQ = 0x10,
22
             MBIC_Download_DATA_REQ,
22
             MBIC_Download_DATA_REQ,
23
             MBIC_Download_Confirm_REQ,
23
             MBIC_Download_Confirm_REQ,
24
-            MBIC_Complete_Notice_REQ_REQ,
24
+            MBIC_Download_Complete_REQ,
25
             MBIC_Reboot_Notice_REQ,
25
             MBIC_Reboot_Notice_REQ,
26
         };
26
         };
27
         public enum MBIC_Download_Rsp_L
27
         public enum MBIC_Download_Rsp_L
@@ -29,7 +29,7 @@ namespace Jdas_Mbic
29
             MBIC_Notice_RSP = 0x90,
29
             MBIC_Notice_RSP = 0x90,
30
             MBIC_Download_DATA_RSP,
30
             MBIC_Download_DATA_RSP,
31
             MBIC_Download_Confirm_RSP,
31
             MBIC_Download_Confirm_RSP,
32
-            MBIC_Complete_Notice_RSP,
32
+            MBIC_Download_Complete_REQ,
33
             MBIC_Reboot_Notice_RSP,
33
             MBIC_Reboot_Notice_RSP,
34
         };
34
         };
35
 
35
 
@@ -94,19 +94,19 @@ namespace Jdas_Mbic
94
         {
94
         {
95
             bool ret = false;
95
             bool ret = false;
96
             Crc16 crc = new Crc16();
96
             Crc16 crc = new Crc16();
97
-            byte length, crcindex;
97
+            ushort length, crcindex;
98
             try
98
             try
99
             {
99
             {
100
-                length = data[2];
100
+                length = Convert.ToUInt16((data[19] << 8) | data[20]);
101
             }
101
             }
102
             catch
102
             catch
103
             {
103
             {
104
                 return ret;
104
                 return ret;
105
             }
105
             }
106
-            crcindex = (byte)(length + 1);
106
+            crcindex = (byte)(length);
107
             try
107
             try
108
             {
108
             {
109
-                ret = crc.CRC16_Check(data, length, data[crcindex]);
109
+                ret = crc.MBIC_CRC16_Check(data, length, Convert.ToUInt16(data[22 + crcindex] << 8 | data[22 + crcindex + 1]));
110
             }
110
             }
111
             catch (Exception e)
111
             catch (Exception e)
112
             {
112
             {
@@ -141,6 +141,7 @@ namespace Jdas_Mbic
141
             UInt16 CRCRET = 0;
141
             UInt16 CRCRET = 0;
142
             int Length = 0;
142
             int Length = 0;
143
             int LastFrame = 0;
143
             int LastFrame = 0;
144
+            int SendDataLength = 0;
144
             ushort  crcret = 0;
145
             ushort  crcret = 0;
145
             byte[] datatmp = new byte[100];
146
             byte[] datatmp = new byte[100];
146
             DataCheck = MBIC_HeaderCheck(data); // MBIC Header Check
147
             DataCheck = MBIC_HeaderCheck(data); // MBIC Header Check
@@ -214,69 +215,60 @@ namespace Jdas_Mbic
214
                                        | (data[(int)MBICProt_st.MBIC_PAYLOADSTART + 7]);
215
                                        | (data[(int)MBICProt_st.MBIC_PAYLOADSTART + 7]);
215
                             if (LastFrame + 1 != Length)
216
                             if (LastFrame + 1 != Length)
216
                             {
217
                             {
217
-                                if (Length == this.main_Form.MBIC_BootLoader_DataArray.Length)
218
-                                    this.fileDownload.MBIC_FirmwareUpdateSend(ref this.serial, this.main_Form.MBIC_BootLoader_DataArray);
218
+                                this.fileDownload.MBIC_FirmwareUpdateSend(ref this.serial, this.main_Form.MBIC_BootLoader_DataArray);
219
                             }
219
                             }
220
                             else
220
                             else
221
                             {
221
                             {
222
-                                crcret = crc.CRC16_Generate(this.main_Form.MBIC_BootLoader_DataArray, this.main_Form.MBIC_BootLoader_DataArray.Length);
222
+                                crcret = crc.Download_CRC16_Generate(this.main_Form.MBIC_BootLoader_DataArray, this.main_Form.MBIC_BootLoader_DataArray.Length);
223
+
223
                                 datatmp[0] = (data[(int)MBICProt_st.MBIC_PAYLOADSTART + 0]);
224
                                 datatmp[0] = (data[(int)MBICProt_st.MBIC_PAYLOADSTART + 0]);
224
                                 datatmp[1] =  (data[(int)MBICProt_st.MBIC_PAYLOADSTART + 1]);
225
                                 datatmp[1] =  (data[(int)MBICProt_st.MBIC_PAYLOADSTART + 1]);
225
                                 datatmp[2] =  (data[(int)MBICProt_st.MBIC_PAYLOADSTART + 2]);
226
                                 datatmp[2] =  (data[(int)MBICProt_st.MBIC_PAYLOADSTART + 2]);
226
                                 datatmp[3] =  (data[(int)MBICProt_st.MBIC_PAYLOADSTART + 3]);
227
                                 datatmp[3] =  (data[(int)MBICProt_st.MBIC_PAYLOADSTART + 3]);
227
-                                datatmp[4] = Convert.ToByte(crcret & 0xFF00 >> 8);
228
-                                datatmp[5] = Convert.ToByte(crcret & 0xFF00 >> 8);
228
+                                datatmp[4] = Convert.ToByte((crcret & 0xFF00) >> 8);
229
+                                datatmp[5] = Convert.ToByte(crcret & 0x00FF);
229
                                 datatmp[6] = 0;     /*Reserve*/
230
                                 datatmp[6] = 0;     /*Reserve*/
230
                                 datatmp[7] = 0;     /*Reserve*/
231
                                 datatmp[7] = 0;     /*Reserve*/
231
                                 datatmp[8] = 0;     /*Reserve*/
232
                                 datatmp[8] = 0;     /*Reserve*/
232
                                 datatmp[9] = 0;     /*Reserve*/
233
                                 datatmp[9] = 0;     /*Reserve*/
233
                                 datatmp[10] =0;     /*Reserve*/
234
                                 datatmp[10] =0;     /*Reserve*/
234
                                 datatmp[11] = 0;    /*Reserve*/
235
                                 datatmp[11] = 0;    /*Reserve*/
235
-
236
                                 datatmp = bluecell_BootProtocol.MBIC_HeaderMergeFunction(datatmp, 12);
236
                                 datatmp = bluecell_BootProtocol.MBIC_HeaderMergeFunction(datatmp, 12);
237
-                                this.serial.Serial_DataSend(datatmp, 22 + 12 + 3);
237
+
238
+                                SendDataLength = 22 + 12 + 3;
239
+
240
+                                datatmp[(int)MBICProt_st.MBIC_LENGTH_0] = (Byte)(((SendDataLength - 25) & 0xFF00) >> 8);
241
+                                datatmp[(int)MBICProt_st.MBIC_LENGTH_1] = (Byte)((SendDataLength - 25)  & 0x00FF);
242
+
243
+                                crcret = crc.MBIC_CRC16_Generate(datatmp, SendDataLength - 25); //Length = Total Length - Header Length - Taile Length
244
+                                datatmp[SendDataLength - 3] = Convert.ToByte((crcret & 0xFF00) >> 8);
245
+                                datatmp[SendDataLength - 2] = Convert.ToByte(crcret & 0x00FF);
246
+                                datatmp[(int)MBICProt_st.MBIC_CMD_0] = 0x12;
247
+                                datatmp[(int)MBICProt_st.MBIC_HEADERCHECKSUM_0] = crc.Chksum_Create(datatmp);
248
+
249
+                                this.serial.Serial_DataSend(datatmp, SendDataLength);
238
                             }
250
                             }
239
                             
251
                             
240
                             break;
252
                             break;
241
                         case (byte)MBIC_Download_Rsp_L.MBIC_Download_Confirm_RSP:
253
                         case (byte)MBIC_Download_Rsp_L.MBIC_Download_Confirm_RSP:
242
-                            Length = (data[(int)MBICProt_st.MBIC_PAYLOADSTART + 0] << 24)
243
-                                    | (data[(int)MBICProt_st.MBIC_PAYLOADSTART + 1] << 16)
244
-                                    | (data[(int)MBICProt_st.MBIC_PAYLOADSTART + 2] << 8)
245
-                                    | (data[(int)MBICProt_st.MBIC_PAYLOADSTART + 3]);
246
-                            CRCRET = crc.CRC16_Generate(this.main_Form.MBIC_BootLoader_DataArray, this.main_Form.MBIC_BootLoader_DataArray.Length);
254
+                                datatmp[0] = 0;//(data[(int)MBICProt_st.MBIC_PAYLOADSTART + 0]);
255
+                                datatmp = bluecell_BootProtocol.MBIC_HeaderMergeFunction(datatmp, 1);
247
 
256
 
248
-                            LastFrame = (data[(int)MBICProt_st.MBIC_PAYLOADSTART + 4] << 24)
249
-                                       | (data[(int)MBICProt_st.MBIC_PAYLOADSTART + 5] << 16)
250
-                                       | (data[(int)MBICProt_st.MBIC_PAYLOADSTART + 6] << 8)
251
-                                       | (data[(int)MBICProt_st.MBIC_PAYLOADSTART + 7]);
252
-                            if (LastFrame + 1 != Length)
253
-                            {
254
-                                if (Length == this.main_Form.MBIC_BootLoader_DataArray.Length)
255
-                                    this.fileDownload.MBIC_FirmwareUpdateSend(ref this.serial, this.main_Form.MBIC_BootLoader_DataArray);
256
-                            }
257
-                            else
258
-                            {
259
-                                crcret = crc.CRC16_Generate(this.main_Form.MBIC_BootLoader_DataArray, this.main_Form.MBIC_BootLoader_DataArray.Length);
260
-                                datatmp[0] = (data[(int)MBICProt_st.MBIC_PAYLOADSTART + 0]);
261
-                                datatmp[1] = (data[(int)MBICProt_st.MBIC_PAYLOADSTART + 1]);
262
-                                datatmp[2] = (data[(int)MBICProt_st.MBIC_PAYLOADSTART + 2]);
263
-                                datatmp[3] = (data[(int)MBICProt_st.MBIC_PAYLOADSTART + 3]);
264
-                                datatmp[4] = Convert.ToByte(crcret & 0xFF00 >> 8);
265
-                                datatmp[5] = Convert.ToByte(crcret & 0xFF00 >> 8);
266
-                                datatmp[6] = 0;     /*Reserve*/
267
-                                datatmp[7] = 0;     /*Reserve*/
268
-                                datatmp[8] = 0;     /*Reserve*/
269
-                                datatmp[9] = 0;     /*Reserve*/
270
-                                datatmp[10] = 0;     /*Reserve*/
271
-                                datatmp[11] = 0;    /*Reserve*/
257
+                            SendDataLength = 22 + 1 + 3;
272
 
258
 
273
-                                datatmp = bluecell_BootProtocol.MBIC_HeaderMergeFunction(datatmp, 12);
274
-                                this.serial.Serial_DataSend(datatmp, 22 + 12 + 3);
275
-                            }
259
+                            datatmp[(int)MBICProt_st.MBIC_LENGTH_0] = (Byte)(((SendDataLength - 25) & 0xFF00) >> 8);
260
+                            datatmp[(int)MBICProt_st.MBIC_LENGTH_1] = (Byte)((SendDataLength - 25) & 0x00FF);
261
+
262
+                            crcret = crc.MBIC_CRC16_Generate(datatmp, SendDataLength - 25); //Length = Total Length - Header Length - Taile Length
263
+                            datatmp[SendDataLength - 3] = Convert.ToByte((crcret & 0xFF00) >> 8);
264
+                            datatmp[SendDataLength - 2] = Convert.ToByte(crcret & 0x00FF);
265
+
266
+                            datatmp[(int)MBICProt_st.MBIC_CMD_0] = 0x13;
267
+                                datatmp[(int)MBICProt_st.MBIC_HEADERCHECKSUM_0] = crc.Chksum_Create(datatmp);
268
+                            this.serial.Serial_DataSend(datatmp, 22 + 1 + 3);
276
 
269
 
277
                             break;
270
                             break;
278
-                        case (byte)MBIC_Download_Rsp_L.MBIC_Reboot_Notice_RSP:
279
-                            
271
+                        case (byte)MBIC_Download_Rsp_L.MBIC_Download_Complete_REQ:
280
                             break;
272
                             break;
281
                     }
273
                     }
282
                 }
274
                 }

+ 46 - 19
Jdas_Mbic/Func/Update_Serial.cs

@@ -260,36 +260,54 @@ namespace Jdas_Mbic
260
         static int MBIC_SendingIndex = 0;
260
         static int MBIC_SendingIndex = 0;
261
         public void MBIC_FirmwareUpdateSend(ref Serial serial,byte[] data)
261
         public void MBIC_FirmwareUpdateSend(ref Serial serial,byte[] data)
262
         {
262
         {
263
+            int SendDataLength = 0;
263
             int Length = data.Length;// + 128;
264
             int Length = data.Length;// + 128;
264
             int cnt = data.Length / 1024;
265
             int cnt = data.Length / 1024;
265
             int reminder = data.Length % 1024;
266
             int reminder = data.Length % 1024;
266
-            
267
             byte[] SendArray = new byte[1061];//1024 + 22 + 3 + 12
267
             byte[] SendArray = new byte[1061];//1024 + 22 + 3 + 12
268
+            int Totalframe = data.Length / 1024;
269
+            int CurrFrame = 0;
270
+            UInt16 CrcRet = 0;
271
+            if (Totalframe % 1024 > 0)
272
+            {
273
+                Totalframe += 1;
274
+            }
275
+
268
             //MBIC_SendingCnt++;
276
             //MBIC_SendingCnt++;
269
 
277
 
270
             //if (MBIC_SendingCnt <= cnt)
278
             //if (MBIC_SendingCnt <= cnt)
279
+            
271
             if (Length - MBIC_SendingIndex >= 1024)
280
             if (Length - MBIC_SendingIndex >= 1024)
272
             {
281
             {
273
                 Array.Copy(data, MBIC_SendingIndex, SendArray, 12, 1024);
282
                 Array.Copy(data, MBIC_SendingIndex, SendArray, 12, 1024);
274
                 MBIC_SendingIndex += 1024 ;
283
                 MBIC_SendingIndex += 1024 ;
284
+                CurrFrame = MBIC_SendingIndex / 1024;
275
                 //SendArray = 
285
                 //SendArray = 
276
-                SendArray[0] = Convert.ToByte((Length & 0xFF000000) >> 24);
277
-                SendArray[1] = Convert.ToByte((Length & 0x00FF0000) >> 16);
278
-                SendArray[2] = Convert.ToByte((Length & 0x0000FF00) >> 8);
279
-                SendArray[3] = Convert.ToByte((Length & 0x000000FF));
286
+                SendArray[0] = Convert.ToByte((Totalframe & 0xFF000000) >> 24);
287
+                SendArray[1] = Convert.ToByte((Totalframe & 0x00FF0000) >> 16);
288
+                SendArray[2] = Convert.ToByte((Totalframe & 0x0000FF00) >> 8);
289
+                SendArray[3] = Convert.ToByte((Totalframe & 0x000000FF));
280
 
290
 
281
 
291
 
282
                
292
                
283
-                SendArray[4] = Convert.ToByte((MBIC_SendingIndex - 1& 0xFF000000) >> 24);
284
-                SendArray[5] = Convert.ToByte((MBIC_SendingIndex - 1& 0x00FF0000) >> 16);
285
-                SendArray[6] = Convert.ToByte((MBIC_SendingIndex - 1& 0x0000FF00) >> 8);
286
-                SendArray[7] = Convert.ToByte((MBIC_SendingIndex - 1& 0x000000FF));
293
+                SendArray[4] = Convert.ToByte((CurrFrame - 1& 0xFF000000) >> 24);
294
+                SendArray[5] = Convert.ToByte((CurrFrame - 1& 0x00FF0000) >> 16);
295
+                SendArray[6] = Convert.ToByte((CurrFrame - 1& 0x0000FF00) >> 8);
296
+                SendArray[7] = Convert.ToByte((CurrFrame - 1& 0x000000FF));
287
 
297
 
288
 
298
 
289
                 SendArray = Bluecell_BootProtocol.MBIC_HeaderMergeFunction(SendArray, SendArray.Length);
299
                 SendArray = Bluecell_BootProtocol.MBIC_HeaderMergeFunction(SendArray, SendArray.Length);
290
                 SendArray[(int)MBICProt_st.MBIC_CMD_0] = 0x11;
300
                 SendArray[(int)MBICProt_st.MBIC_CMD_0] = 0x11;
301
+
302
+                SendDataLength = 1024 + 22 + 12 + 3;
303
+                SendArray[(int)MBICProt_st.MBIC_LENGTH_0] = (Byte)(((SendDataLength - 25) & 0xFF00) >> 8);
304
+                SendArray[(int)MBICProt_st.MBIC_LENGTH_1] = (Byte)((SendDataLength - 25) & 0x00FF);
291
                 SendArray[(int)MBICProt_st.MBIC_HEADERCHECKSUM_0] = crc.Chksum_Create(SendArray);
305
                 SendArray[(int)MBICProt_st.MBIC_HEADERCHECKSUM_0] = crc.Chksum_Create(SendArray);
292
-                serial.Serial_DataSend(SendArray, 1024 + 22 + 12 + 3);
306
+                CrcRet = crc.MBIC_CRC16_Generate(SendArray, SendDataLength - 25); //Length = Total Length - Header Length - Taile Length
307
+                SendArray[SendDataLength - 3] = Convert.ToByte((CrcRet & 0xFF00) >> 8); 
308
+                SendArray[SendDataLength - 2] = Convert.ToByte(CrcRet & 0x00FF);
309
+                SendArray[SendDataLength - 1] = 0x03;
310
+                serial.Serial_DataSend(SendArray, SendDataLength);
293
                 /*
311
                 /*
294
                  * 1024byte : data ,
312
                  * 1024byte : data ,
295
                  * 22byte : Header  
313
                  * 22byte : Header  
@@ -301,24 +319,33 @@ namespace Jdas_Mbic
301
             {
319
             {
302
                 Array.Copy(data, MBIC_SendingIndex, SendArray, 12, reminder);
320
                 Array.Copy(data, MBIC_SendingIndex, SendArray, 12, reminder);
303
                 MBIC_SendingIndex += reminder;
321
                 MBIC_SendingIndex += reminder;
322
+                CurrFrame = MBIC_SendingIndex / 1024;
304
                 //SendArray = 
323
                 //SendArray = 
305
-                SendArray[0] = Convert.ToByte((Length & 0xFF000000) >> 24);
306
-                SendArray[1] = Convert.ToByte((Length & 0x00FF0000) >> 16);
307
-                SendArray[2] = Convert.ToByte((Length & 0x0000FF00) >> 8);
308
-                SendArray[3] = Convert.ToByte((Length & 0x000000FF));
324
+                SendArray[0] = Convert.ToByte((Totalframe & 0xFF000000) >> 24);
325
+                SendArray[1] = Convert.ToByte((Totalframe & 0x00FF0000) >> 16);
326
+                SendArray[2] = Convert.ToByte((Totalframe & 0x0000FF00) >> 8);
327
+                SendArray[3] = Convert.ToByte((Totalframe & 0x000000FF));
309
 
328
 
310
 
329
 
311
-                SendArray[4] = Convert.ToByte((MBIC_SendingIndex - 1& 0xFF000000) >> 24);
312
-                SendArray[5] = Convert.ToByte((MBIC_SendingIndex - 1& 0x00FF0000) >> 16);
313
-                SendArray[6] = Convert.ToByte((MBIC_SendingIndex - 1& 0x0000FF00) >> 8);
314
-                SendArray[7] = Convert.ToByte((MBIC_SendingIndex - 1& 0x000000FF));
330
+                SendArray[4] = Convert.ToByte((CurrFrame & 0xFF000000) >> 24);
331
+                SendArray[5] = Convert.ToByte((CurrFrame & 0x00FF0000) >> 16);
332
+                SendArray[6] = Convert.ToByte((CurrFrame & 0x0000FF00) >> 8);
333
+                SendArray[7] = Convert.ToByte((CurrFrame & 0x000000FF));
315
 
334
 
316
 
335
 
317
                 SendArray = Bluecell_BootProtocol.MBIC_HeaderMergeFunction(SendArray, SendArray.Length);
336
                 SendArray = Bluecell_BootProtocol.MBIC_HeaderMergeFunction(SendArray, SendArray.Length);
318
                 SendArray[(int)MBICProt_st.MBIC_CMD_0] = 0x11;
337
                 SendArray[(int)MBICProt_st.MBIC_CMD_0] = 0x11;
338
+
339
+                SendDataLength = reminder + 22 + 12 + 3;
340
+                SendArray[(int)MBICProt_st.MBIC_LENGTH_0] = (Byte)(((SendDataLength - 25) & 0xFF00) >> 8);
341
+                SendArray[(int)MBICProt_st.MBIC_LENGTH_1] = (Byte)((SendDataLength - 25) & 0x00FF);
319
                 SendArray[(int)MBICProt_st.MBIC_HEADERCHECKSUM_0] = crc.Chksum_Create(SendArray);
342
                 SendArray[(int)MBICProt_st.MBIC_HEADERCHECKSUM_0] = crc.Chksum_Create(SendArray);
320
 
343
 
321
-                serial.Serial_DataSend(SendArray, reminder + 22 + 12 + 3);
344
+                CrcRet = crc.MBIC_CRC16_Generate(SendArray, SendDataLength - 25); //Length = Total Length - Header Length - Taile Length
345
+                SendArray[SendDataLength - 3] = Convert.ToByte((CrcRet & 0xFF00) >> 8);
346
+                SendArray[SendDataLength - 2] = Convert.ToByte(CrcRet & 0x00FF);
347
+                SendArray[SendDataLength - 1] = 0x03;
348
+                serial.Serial_DataSend(SendArray, SendDataLength);
322
                // MBIC_SendingCnt = 0;
349
                // MBIC_SendingCnt = 0;
323
                 MBIC_SendingIndex = 0;
350
                 MBIC_SendingIndex = 0;
324
             }
351
             }

+ 138 - 23
Jdas_Mbic/Main.Designer.cs

@@ -103,6 +103,15 @@
103
             this.button1 = new System.Windows.Forms.Button();
103
             this.button1 = new System.Windows.Forms.Button();
104
             this.button_FactorySet = new System.Windows.Forms.Button();
104
             this.button_FactorySet = new System.Windows.Forms.Button();
105
             this.panel1 = new System.Windows.Forms.Panel();
105
             this.panel1 = new System.Windows.Forms.Panel();
106
+            this.button_PCBVersionSet = new System.Windows.Forms.Button();
107
+            this.button_SerialNumverSet = new System.Windows.Forms.Button();
108
+            this.button_ManufactureSet = new System.Windows.Forms.Button();
109
+            this.label4 = new System.Windows.Forms.Label();
110
+            this.textBox10 = new System.Windows.Forms.TextBox();
111
+            this.label5 = new System.Windows.Forms.Label();
112
+            this.label_SerialNumber = new System.Windows.Forms.Label();
113
+            this.textBox_PcbVersion = new System.Windows.Forms.TextBox();
114
+            this.textBox_SerialNumber = new System.Windows.Forms.TextBox();
106
             this.label_CompileDate = new System.Windows.Forms.Label();
115
             this.label_CompileDate = new System.Windows.Forms.Label();
107
             this.label7 = new System.Windows.Forms.Label();
116
             this.label7 = new System.Windows.Forms.Label();
108
             this.button_SelfTest2 = new System.Windows.Forms.Button();
117
             this.button_SelfTest2 = new System.Windows.Forms.Button();
@@ -144,10 +153,11 @@
144
             this.textBox_UL_ShutdownLimit = new System.Windows.Forms.TextBox();
153
             this.textBox_UL_ShutdownLimit = new System.Windows.Forms.TextBox();
145
             this.textBox_DLI_AGC_Threshold = new System.Windows.Forms.TextBox();
154
             this.textBox_DLI_AGC_Threshold = new System.Windows.Forms.TextBox();
146
             this.textBox_ULO_ALC_Threshold = new System.Windows.Forms.TextBox();
155
             this.textBox_ULO_ALC_Threshold = new System.Windows.Forms.TextBox();
147
-            this.textBox12 = new System.Windows.Forms.TextBox();
156
+            this.textBox_DLI_FRBT_D_Day = new System.Windows.Forms.TextBox();
157
+            this.textBox_FRBT_Status = new System.Windows.Forms.TextBox();
148
             this.textBox1_Carrier = new System.Windows.Forms.TextBox();
158
             this.textBox1_Carrier = new System.Windows.Forms.TextBox();
149
             this.button_Carrier = new System.Windows.Forms.Button();
159
             this.button_Carrier = new System.Windows.Forms.Button();
150
-            this.button10 = new System.Windows.Forms.Button();
160
+            this.button_LedTest = new System.Windows.Forms.Button();
151
             this.textBox_CardType = new System.Windows.Forms.TextBox();
161
             this.textBox_CardType = new System.Windows.Forms.TextBox();
152
             this.textBox_CpuVersion = new System.Windows.Forms.TextBox();
162
             this.textBox_CpuVersion = new System.Windows.Forms.TextBox();
153
             this.panel17 = new System.Windows.Forms.Panel();
163
             this.panel17 = new System.Windows.Forms.Panel();
@@ -395,9 +405,9 @@
395
             // 
405
             // 
396
             // textBox_FRBT_TIME
406
             // textBox_FRBT_TIME
397
             // 
407
             // 
398
-            this.textBox_FRBT_TIME.Location = new System.Drawing.Point(759, 74);
408
+            this.textBox_FRBT_TIME.Location = new System.Drawing.Point(454, 132);
399
             this.textBox_FRBT_TIME.Name = "textBox_FRBT_TIME";
409
             this.textBox_FRBT_TIME.Name = "textBox_FRBT_TIME";
400
-            this.textBox_FRBT_TIME.Size = new System.Drawing.Size(115, 23);
410
+            this.textBox_FRBT_TIME.Size = new System.Drawing.Size(67, 23);
401
             this.textBox_FRBT_TIME.TabIndex = 153;
411
             this.textBox_FRBT_TIME.TabIndex = 153;
402
             this.textBox_FRBT_TIME.Text = "20-07-02-07-09-15";
412
             this.textBox_FRBT_TIME.Text = "20-07-02-07-09-15";
403
             // 
413
             // 
@@ -1030,9 +1040,9 @@
1030
             // 
1040
             // 
1031
             // button_FRBT_TimeSetting
1041
             // button_FRBT_TimeSetting
1032
             // 
1042
             // 
1033
-            this.button_FRBT_TimeSetting.Location = new System.Drawing.Point(888, 75);
1043
+            this.button_FRBT_TimeSetting.Location = new System.Drawing.Point(534, 133);
1034
             this.button_FRBT_TimeSetting.Name = "button_FRBT_TimeSetting";
1044
             this.button_FRBT_TimeSetting.Name = "button_FRBT_TimeSetting";
1035
-            this.button_FRBT_TimeSetting.Size = new System.Drawing.Size(189, 23);
1045
+            this.button_FRBT_TimeSetting.Size = new System.Drawing.Size(75, 23);
1036
             this.button_FRBT_TimeSetting.TabIndex = 146;
1046
             this.button_FRBT_TimeSetting.TabIndex = 146;
1037
             this.button_FRBT_TimeSetting.Text = "FRBT TIME SETTING";
1047
             this.button_FRBT_TimeSetting.Text = "FRBT TIME SETTING";
1038
             this.button_FRBT_TimeSetting.UseVisualStyleBackColor = true;
1048
             this.button_FRBT_TimeSetting.UseVisualStyleBackColor = true;
@@ -1539,6 +1549,15 @@
1539
             // panel1
1549
             // panel1
1540
             // 
1550
             // 
1541
             this.panel1.BackColor = System.Drawing.Color.White;
1551
             this.panel1.BackColor = System.Drawing.Color.White;
1552
+            this.panel1.Controls.Add(this.button_PCBVersionSet);
1553
+            this.panel1.Controls.Add(this.button_SerialNumverSet);
1554
+            this.panel1.Controls.Add(this.button_ManufactureSet);
1555
+            this.panel1.Controls.Add(this.label4);
1556
+            this.panel1.Controls.Add(this.textBox10);
1557
+            this.panel1.Controls.Add(this.label5);
1558
+            this.panel1.Controls.Add(this.label_SerialNumber);
1559
+            this.panel1.Controls.Add(this.textBox_PcbVersion);
1560
+            this.panel1.Controls.Add(this.textBox_SerialNumber);
1542
             this.panel1.Controls.Add(this.label_CompileDate);
1561
             this.panel1.Controls.Add(this.label_CompileDate);
1543
             this.panel1.Controls.Add(this.label7);
1562
             this.panel1.Controls.Add(this.label7);
1544
             this.panel1.Controls.Add(this.label_CPU_Version);
1563
             this.panel1.Controls.Add(this.label_CPU_Version);
@@ -1587,10 +1606,11 @@
1587
             this.panel1.Controls.Add(this.textBox_UL_ShutdownLimit);
1606
             this.panel1.Controls.Add(this.textBox_UL_ShutdownLimit);
1588
             this.panel1.Controls.Add(this.textBox_DLI_AGC_Threshold);
1607
             this.panel1.Controls.Add(this.textBox_DLI_AGC_Threshold);
1589
             this.panel1.Controls.Add(this.textBox_ULO_ALC_Threshold);
1608
             this.panel1.Controls.Add(this.textBox_ULO_ALC_Threshold);
1590
-            this.panel1.Controls.Add(this.textBox12);
1609
+            this.panel1.Controls.Add(this.textBox_DLI_FRBT_D_Day);
1610
+            this.panel1.Controls.Add(this.textBox_FRBT_Status);
1591
             this.panel1.Controls.Add(this.textBox1_Carrier);
1611
             this.panel1.Controls.Add(this.textBox1_Carrier);
1592
             this.panel1.Controls.Add(this.button_Carrier);
1612
             this.panel1.Controls.Add(this.button_Carrier);
1593
-            this.panel1.Controls.Add(this.button10);
1613
+            this.panel1.Controls.Add(this.button_LedTest);
1594
             this.panel1.Controls.Add(this.textBox_CardType);
1614
             this.panel1.Controls.Add(this.textBox_CardType);
1595
             this.panel1.Controls.Add(this.textBox_CpuVersion);
1615
             this.panel1.Controls.Add(this.textBox_CpuVersion);
1596
             this.panel1.Controls.Add(this.panel17);
1616
             this.panel1.Controls.Add(this.panel17);
@@ -1627,6 +1647,84 @@
1627
             this.panel1.Size = new System.Drawing.Size(1136, 895);
1647
             this.panel1.Size = new System.Drawing.Size(1136, 895);
1628
             this.panel1.TabIndex = 159;
1648
             this.panel1.TabIndex = 159;
1629
             // 
1649
             // 
1650
+            // button_PCBVersionSet
1651
+            // 
1652
+            this.button_PCBVersionSet.Location = new System.Drawing.Point(888, 131);
1653
+            this.button_PCBVersionSet.Name = "button_PCBVersionSet";
1654
+            this.button_PCBVersionSet.Size = new System.Drawing.Size(75, 23);
1655
+            this.button_PCBVersionSet.TabIndex = 165;
1656
+            this.button_PCBVersionSet.Text = "Apply";
1657
+            this.button_PCBVersionSet.UseVisualStyleBackColor = true;
1658
+            this.button_PCBVersionSet.Click += new System.EventHandler(this.button_PCBVersionSet_Click);
1659
+            // 
1660
+            // button_SerialNumverSet
1661
+            // 
1662
+            this.button_SerialNumverSet.Location = new System.Drawing.Point(888, 102);
1663
+            this.button_SerialNumverSet.Name = "button_SerialNumverSet";
1664
+            this.button_SerialNumverSet.Size = new System.Drawing.Size(75, 23);
1665
+            this.button_SerialNumverSet.TabIndex = 165;
1666
+            this.button_SerialNumverSet.Text = "Apply";
1667
+            this.button_SerialNumverSet.UseVisualStyleBackColor = true;
1668
+            this.button_SerialNumverSet.Click += new System.EventHandler(this.button_SerialNumverSet_Click);
1669
+            // 
1670
+            // button_ManufactureSet
1671
+            // 
1672
+            this.button_ManufactureSet.Location = new System.Drawing.Point(888, 73);
1673
+            this.button_ManufactureSet.Name = "button_ManufactureSet";
1674
+            this.button_ManufactureSet.Size = new System.Drawing.Size(75, 23);
1675
+            this.button_ManufactureSet.TabIndex = 165;
1676
+            this.button_ManufactureSet.Text = "Apply";
1677
+            this.button_ManufactureSet.UseVisualStyleBackColor = true;
1678
+            this.button_ManufactureSet.Click += new System.EventHandler(this.button_ManufactureSet_Click);
1679
+            // 
1680
+            // label4
1681
+            // 
1682
+            this.label4.AutoSize = true;
1683
+            this.label4.Location = new System.Drawing.Point(673, 76);
1684
+            this.label4.Name = "label4";
1685
+            this.label4.Size = new System.Drawing.Size(59, 15);
1686
+            this.label4.TabIndex = 164;
1687
+            this.label4.Text = "제조 일자";
1688
+            // 
1689
+            // textBox10
1690
+            // 
1691
+            this.textBox10.Location = new System.Drawing.Point(759, 73);
1692
+            this.textBox10.Name = "textBox10";
1693
+            this.textBox10.Size = new System.Drawing.Size(115, 23);
1694
+            this.textBox10.TabIndex = 163;
1695
+            // 
1696
+            // label5
1697
+            // 
1698
+            this.label5.AutoSize = true;
1699
+            this.label5.Location = new System.Drawing.Point(670, 135);
1700
+            this.label5.Name = "label5";
1701
+            this.label5.Size = new System.Drawing.Size(73, 15);
1702
+            this.label5.TabIndex = 162;
1703
+            this.label5.Text = "PCB Version";
1704
+            // 
1705
+            // label_SerialNumber
1706
+            // 
1707
+            this.label_SerialNumber.AutoSize = true;
1708
+            this.label_SerialNumber.Location = new System.Drawing.Point(666, 106);
1709
+            this.label_SerialNumber.Name = "label_SerialNumber";
1710
+            this.label_SerialNumber.Size = new System.Drawing.Size(71, 15);
1711
+            this.label_SerialNumber.TabIndex = 161;
1712
+            this.label_SerialNumber.Text = "시리얼 넘버";
1713
+            // 
1714
+            // textBox_PcbVersion
1715
+            // 
1716
+            this.textBox_PcbVersion.Location = new System.Drawing.Point(759, 132);
1717
+            this.textBox_PcbVersion.Name = "textBox_PcbVersion";
1718
+            this.textBox_PcbVersion.Size = new System.Drawing.Size(115, 23);
1719
+            this.textBox_PcbVersion.TabIndex = 159;
1720
+            // 
1721
+            // textBox_SerialNumber
1722
+            // 
1723
+            this.textBox_SerialNumber.Location = new System.Drawing.Point(759, 103);
1724
+            this.textBox_SerialNumber.Name = "textBox_SerialNumber";
1725
+            this.textBox_SerialNumber.Size = new System.Drawing.Size(115, 23);
1726
+            this.textBox_SerialNumber.TabIndex = 158;
1727
+            // 
1630
             // label_CompileDate
1728
             // label_CompileDate
1631
             // 
1729
             // 
1632
             this.label_CompileDate.AutoSize = true;
1730
             this.label_CompileDate.AutoSize = true;
@@ -2027,12 +2125,19 @@
2027
             this.textBox_ULO_ALC_Threshold.Size = new System.Drawing.Size(65, 23);
2125
             this.textBox_ULO_ALC_Threshold.Size = new System.Drawing.Size(65, 23);
2028
             this.textBox_ULO_ALC_Threshold.TabIndex = 12;
2126
             this.textBox_ULO_ALC_Threshold.TabIndex = 12;
2029
             // 
2127
             // 
2030
-            // textBox12
2128
+            // textBox_DLI_FRBT_D_Day
2129
+            // 
2130
+            this.textBox_DLI_FRBT_D_Day.Location = new System.Drawing.Point(534, 76);
2131
+            this.textBox_DLI_FRBT_D_Day.Name = "textBox_DLI_FRBT_D_Day";
2132
+            this.textBox_DLI_FRBT_D_Day.Size = new System.Drawing.Size(75, 23);
2133
+            this.textBox_DLI_FRBT_D_Day.TabIndex = 11;
2134
+            // 
2135
+            // textBox_FRBT_Status
2031
             // 
2136
             // 
2032
-            this.textBox12.Location = new System.Drawing.Point(534, 104);
2033
-            this.textBox12.Name = "textBox12";
2034
-            this.textBox12.Size = new System.Drawing.Size(75, 23);
2035
-            this.textBox12.TabIndex = 11;
2137
+            this.textBox_FRBT_Status.Location = new System.Drawing.Point(534, 104);
2138
+            this.textBox_FRBT_Status.Name = "textBox_FRBT_Status";
2139
+            this.textBox_FRBT_Status.Size = new System.Drawing.Size(75, 23);
2140
+            this.textBox_FRBT_Status.TabIndex = 11;
2036
             // 
2141
             // 
2037
             // textBox1_Carrier
2142
             // textBox1_Carrier
2038
             // 
2143
             // 
@@ -2051,15 +2156,15 @@
2051
             this.button_Carrier.UseVisualStyleBackColor = true;
2156
             this.button_Carrier.UseVisualStyleBackColor = true;
2052
             this.button_Carrier.Click += new System.EventHandler(this.button_PATH_Ctrl_Click);
2157
             this.button_Carrier.Click += new System.EventHandler(this.button_PATH_Ctrl_Click);
2053
             // 
2158
             // 
2054
-            // button10
2159
+            // button_LedTest
2055
             // 
2160
             // 
2056
-            this.button10.Location = new System.Drawing.Point(244, 73);
2057
-            this.button10.Name = "button10";
2058
-            this.button10.Size = new System.Drawing.Size(75, 23);
2059
-            this.button10.TabIndex = 7;
2060
-            this.button10.Text = "LED TEST";
2061
-            this.button10.UseVisualStyleBackColor = true;
2062
-            this.button10.Click += new System.EventHandler(this.button_PATH_Ctrl_Click);
2161
+            this.button_LedTest.Location = new System.Drawing.Point(244, 73);
2162
+            this.button_LedTest.Name = "button_LedTest";
2163
+            this.button_LedTest.Size = new System.Drawing.Size(75, 23);
2164
+            this.button_LedTest.TabIndex = 7;
2165
+            this.button_LedTest.Text = "LED TEST";
2166
+            this.button_LedTest.UseVisualStyleBackColor = true;
2167
+            this.button_LedTest.Click += new System.EventHandler(this.button_LedTest_Click);
2063
             // 
2168
             // 
2064
             // textBox_CardType
2169
             // textBox_CardType
2065
             // 
2170
             // 
@@ -3604,11 +3709,11 @@
3604
         private System.Windows.Forms.TextBox textBox_UL_ShutdownLimit;
3709
         private System.Windows.Forms.TextBox textBox_UL_ShutdownLimit;
3605
         private System.Windows.Forms.TextBox textBox_DLI_AGC_Threshold;
3710
         private System.Windows.Forms.TextBox textBox_DLI_AGC_Threshold;
3606
         private System.Windows.Forms.TextBox textBox_ULO_ALC_Threshold;
3711
         private System.Windows.Forms.TextBox textBox_ULO_ALC_Threshold;
3607
-        private System.Windows.Forms.TextBox textBox12;
3712
+        private System.Windows.Forms.TextBox textBox_FRBT_Status;
3608
         private System.Windows.Forms.NumericUpDown numericUpDown1;
3713
         private System.Windows.Forms.NumericUpDown numericUpDown1;
3609
         private System.Windows.Forms.TextBox textBox1_Carrier;
3714
         private System.Windows.Forms.TextBox textBox1_Carrier;
3610
         private System.Windows.Forms.Button button_Carrier;
3715
         private System.Windows.Forms.Button button_Carrier;
3611
-        private System.Windows.Forms.Button button10;
3716
+        private System.Windows.Forms.Button button_LedTest;
3612
         private System.Windows.Forms.TextBox textBox_CardType;
3717
         private System.Windows.Forms.TextBox textBox_CardType;
3613
         private System.Windows.Forms.TextBox textBox_CpuVersion;
3718
         private System.Windows.Forms.TextBox textBox_CpuVersion;
3614
         private System.Windows.Forms.Panel panel17;
3719
         private System.Windows.Forms.Panel panel17;
@@ -3728,6 +3833,16 @@
3728
         public System.Windows.Forms.TextBox textBox_DET_DL2;
3833
         public System.Windows.Forms.TextBox textBox_DET_DL2;
3729
         public System.Windows.Forms.TextBox textBox_DET_UL2;
3834
         public System.Windows.Forms.TextBox textBox_DET_UL2;
3730
         private System.Windows.Forms.Button button_Exit;
3835
         private System.Windows.Forms.Button button_Exit;
3836
+        private System.Windows.Forms.TextBox textBox_DLI_FRBT_D_Day;
3837
+        private System.Windows.Forms.Label label5;
3838
+        private System.Windows.Forms.Label label_SerialNumber;
3839
+        private System.Windows.Forms.TextBox textBox_PcbVersion;
3840
+        private System.Windows.Forms.TextBox textBox_SerialNumber;
3841
+        private System.Windows.Forms.Label label4;
3842
+        private System.Windows.Forms.TextBox textBox10;
3843
+        private System.Windows.Forms.Button button_PCBVersionSet;
3844
+        private System.Windows.Forms.Button button_SerialNumverSet;
3845
+        private System.Windows.Forms.Button button_ManufactureSet;
3731
     }
3846
     }
3732
 }
3847
 }
3733
 
3848
 

+ 131 - 13
Jdas_Mbic/Main.cs

@@ -1083,9 +1083,22 @@ namespace Jdas_Mbic
1083
                 case (int)HFR_CardType_t.MBIC_KDDI: this.Invoke(new StringSend(TextBox_Text_Set), textBox_CardType, "LTE-KDDI"); break;
1083
                 case (int)HFR_CardType_t.MBIC_KDDI: this.Invoke(new StringSend(TextBox_Text_Set), textBox_CardType, "LTE-KDDI"); break;
1084
                 default: this.Invoke(new StringSend(TextBox_Text_Set), textBox_CardType, "ID None"); break;
1084
                 default: this.Invoke(new StringSend(TextBox_Text_Set), textBox_CardType, "ID None"); break;
1085
             }
1085
             }
1086
+            this.Invoke(new StringSend(TextBox_Text_Set), textBox_DLI_FRBT_D_Day, buf[(int)BluecellReqIndex.DLI_FRBT_D_Day].ToString());// = false;
1086
 
1087
 
1087
-            
1088
-            if (buf[(int)BluecellReqIndex.Carrier_ON_OFF] == 0)
1088
+            if (buf[(int)BluecellReqIndex.DLI_FRBT_Status] == 0)
1089
+            {
1090
+                this.Invoke(new StringSend(TextBox_Text_Set), textBox_FRBT_Status, "IDLE");// = false;
1091
+            }
1092
+            else if (buf[(int)BluecellReqIndex.DLI_FRBT_Status] == 1)
1093
+            {
1094
+                this.Invoke(new StringSend(TextBox_Text_Set), textBox_FRBT_Status, "TRACKING");// = false;
1095
+            }
1096
+            else if (buf[(int)BluecellReqIndex.DLI_FRBT_Status] == 2)
1097
+            {
1098
+                this.Invoke(new StringSend(TextBox_Text_Set), textBox_FRBT_Status, "RUNNING");// = false;
1099
+            }
1100
+
1101
+                if (buf[(int)BluecellReqIndex.Carrier_ON_OFF] == 0)
1089
             {
1102
             {
1090
                 this.Invoke(new StringSend(Button_Text_Set), button_Carrier, "OFF");// = false;
1103
                 this.Invoke(new StringSend(Button_Text_Set), button_Carrier, "OFF");// = false;
1091
                 this.Invoke(new StringSend(TextBox_Text_Set), textBox1_Carrier, "OFF");// = false;
1104
                 this.Invoke(new StringSend(TextBox_Text_Set), textBox1_Carrier, "OFF");// = false;
@@ -1982,13 +1995,16 @@ namespace Jdas_Mbic
1982
 
1995
 
1983
             this.Invoke(new StringSend(Label_Text_Set), label_Temp, adcdata.ToString("N2") + "°C");
1996
             this.Invoke(new StringSend(Label_Text_Set), label_Temp, adcdata.ToString("N2") + "°C");
1984
             adcdata = 0;
1997
             adcdata = 0;
1998
+            //string tmp = Convert.ToInt32(buf[(int)BluecellReqIndex.CPUVERSION3],16).ToString();
1999
+
1985
             string version = Convert.ToString(buf[(int)BluecellReqIndex.CPUVERSION1])
2000
             string version = Convert.ToString(buf[(int)BluecellReqIndex.CPUVERSION1])
1986
                              + "."
2001
                              + "."
1987
                              + Convert.ToString(buf[(int)BluecellReqIndex.CPUVERSION2])
2002
                              + Convert.ToString(buf[(int)BluecellReqIndex.CPUVERSION2])
1988
                              + "."
2003
                              + "."
1989
-                             + Convert.ToString(buf[(int)BluecellReqIndex.CPUVERSION3]);
1990
-            adcdata += (buf[(int)BluecellReqIndex.CPUVERSION2])/10;
1991
-            adcdata += (buf[(int)BluecellReqIndex.CPUVERSION3]);
2004
+                             + Convert.ToInt32(buf[(int)BluecellReqIndex.CPUVERSION3]).ToString("X");
2005
+            //Convert.ToInt32(buf[(int)BluecellReqIndex.CPUVERSION3], 16).ToString();
2006
+            //adcdata += (buf[(int)BluecellReqIndex.CPUVERSION2])/10;
2007
+            //adcdata += (buf[(int)BluecellReqIndex.CPUVERSION3]);
1992
             this.Invoke(new StringSend(TextBox_Text_Set), textBox_CpuVersion, version);
2008
             this.Invoke(new StringSend(TextBox_Text_Set), textBox_CpuVersion, version);
1993
 
2009
 
1994
 
2010
 
@@ -2391,7 +2407,7 @@ namespace Jdas_Mbic
2391
             return crcret ^ ~0U;						
2407
             return crcret ^ ~0U;						
2392
         }
2408
         }
2393
 
2409
 
2394
-public byte[] MBIC_BootLoader_DataArray;
2410
+        public byte[] MBIC_BootLoader_DataArray;
2395
         byte[] MBIC_Add_BootLoader_DataArray = new byte[128];
2411
         byte[] MBIC_Add_BootLoader_DataArray = new byte[128];
2396
         const string MBIC_HeaderName = "JT-NRDAS ";
2412
         const string MBIC_HeaderName = "JT-NRDAS ";
2397
         
2413
         
@@ -2418,15 +2434,20 @@ public byte[] MBIC_BootLoader_DataArray;
2418
         {
2434
         {
2419
             string MBIC_HeaderFileName = "jhfs-mbic-nrdas-v00.00." + numericUpDown_Version.Text+ ".mbc";
2435
             string MBIC_HeaderFileName = "jhfs-mbic-nrdas-v00.00." + numericUpDown_Version.Text+ ".mbc";
2420
             char[] tempchardata;
2436
             char[] tempchardata;
2437
+            int TotalFrame = 0;
2421
             OpenFileDialog Mbic_ofd = new OpenFileDialog();
2438
             OpenFileDialog Mbic_ofd = new OpenFileDialog();
2422
             UInt32 Crcret = 0;
2439
             UInt32 Crcret = 0;
2423
             byte[] tempdata = new byte[1027];
2440
             byte[] tempdata = new byte[1027];
2424
             int i = 0;
2441
             int i = 0;
2442
+            int SendDataLength = 0;
2443
+            UInt16 CrcRet = 0;
2444
+
2445
+
2425
             timer_JdasMbic.Stop(); //타이머를 멈춘다.
2446
             timer_JdasMbic.Stop(); //타이머를 멈춘다.
2426
             //파일오픈창 생성 및 설정
2447
             //파일오픈창 생성 및 설정
2427
             Mbic_ofd.Title = "업데이터 파일 탐색기";
2448
             Mbic_ofd.Title = "업데이터 파일 탐색기";
2428
             Mbic_ofd.FileName = "*.bin";
2449
             Mbic_ofd.FileName = "*.bin";
2429
-            Mbic_ofd.Filter = "binary 파일 (*.binary,*.bin) | *.binary;, *.bin; | 모든 파일 (*.*) | *.*";
2450
+            Mbic_ofd.Filter = "binary 파일 (*.binary,*.bin) | *.binary;, *.bin; |  모든 파일 (*.*) | *.*";
2430
             string s3 = DateTime.Now.ToString("yyMMddHHmmss");
2451
             string s3 = DateTime.Now.ToString("yyMMddHHmmss");
2431
             //string s3 = DateTime.Now.ToString("yyMMdd");
2452
             //string s3 = DateTime.Now.ToString("yyMMdd");
2432
 
2453
 
@@ -2511,17 +2532,35 @@ public byte[] MBIC_BootLoader_DataArray;
2511
                 tempdata[1] = Convert.ToByte(((MBIC_BootLoader_DataArray.Length + 128) & 0x00FF0000) >> 16);
2532
                 tempdata[1] = Convert.ToByte(((MBIC_BootLoader_DataArray.Length + 128) & 0x00FF0000) >> 16);
2512
                 tempdata[2] = Convert.ToByte(((MBIC_BootLoader_DataArray.Length + 128) & 0x0000FF00) >> 8);
2533
                 tempdata[2] = Convert.ToByte(((MBIC_BootLoader_DataArray.Length + 128) & 0x0000FF00) >> 8);
2513
                 tempdata[3] = Convert.ToByte(((MBIC_BootLoader_DataArray.Length + 128) & 0x000000FF));*/
2534
                 tempdata[3] = Convert.ToByte(((MBIC_BootLoader_DataArray.Length + 128) & 0x000000FF));*/
2514
-                tempdata[0] = Convert.ToByte(((MBIC_BootLoader_DataArray.Length) & 0xFF000000) >> 24);
2515
-                tempdata[1] = Convert.ToByte(((MBIC_BootLoader_DataArray.Length) & 0x00FF0000) >> 16);
2516
-                tempdata[2] = Convert.ToByte(((MBIC_BootLoader_DataArray.Length) & 0x0000FF00) >> 8);
2517
-                tempdata[3] = Convert.ToByte(((MBIC_BootLoader_DataArray.Length) & 0x000000FF));
2535
+                TotalFrame = MBIC_BootLoader_DataArray.Length / 1024;
2536
+                if(MBIC_BootLoader_DataArray.Length % 1024 > 0)
2537
+                {
2538
+                    TotalFrame += 1;
2539
+                }
2540
+
2541
+                tempdata[0] = Convert.ToByte(((TotalFrame) & 0xFF000000) >> 24);
2542
+                tempdata[1] = Convert.ToByte(((TotalFrame) & 0x00FF0000) >> 16);
2543
+                tempdata[2] = Convert.ToByte(((TotalFrame) & 0x0000FF00) >> 8);
2544
+                tempdata[3] = Convert.ToByte(((TotalFrame) & 0x000000FF));
2518
                 tempdata[4] = 0;
2545
                 tempdata[4] = 0;
2519
                 tempdata[5] = 0;
2546
                 tempdata[5] = 0;
2520
                 tempdata[6] = 0;
2547
                 tempdata[6] = 0;
2521
                 tempdata[7] = 0;
2548
                 tempdata[7] = 0;
2522
                 tempdata = bluecell_BootProtocol.MBIC_HeaderMergeFunction(tempdata, 8);
2549
                 tempdata = bluecell_BootProtocol.MBIC_HeaderMergeFunction(tempdata, 8);
2523
                 tempdata[(int)MBICProt_st.MBIC_CMD_0] = 0x10;
2550
                 tempdata[(int)MBICProt_st.MBIC_CMD_0] = 0x10;
2551
+
2552
+                SendDataLength = 8 + 22 + 3;
2553
+                tempdata[(int)MBICProt_st.MBIC_LENGTH_0] = 0x00;
2554
+                tempdata[(int)MBICProt_st.MBIC_LENGTH_1] = (Byte)(SendDataLength - 25);
2524
                 tempdata[(int)MBICProt_st.MBIC_HEADERCHECKSUM_0] = crc.Chksum_Create(tempdata);
2555
                 tempdata[(int)MBICProt_st.MBIC_HEADERCHECKSUM_0] = crc.Chksum_Create(tempdata);
2556
+
2557
+
2558
+                CrcRet = crc.MBIC_CRC16_Generate(tempdata, SendDataLength - 25); //Length = Total Length - Header Length - Taile Length
2559
+                tempdata[SendDataLength - 3] = Convert.ToByte((CrcRet & 0xFF00) >> 8);
2560
+                tempdata[SendDataLength - 2] = Convert.ToByte(CrcRet & 0x00FF);
2561
+                tempdata[SendDataLength - 1] = 0x03;
2562
+
2563
+
2525
                 this.serial.Serial_DataSend(tempdata, 8 + 22 + 3);
2564
                 this.serial.Serial_DataSend(tempdata, 8 + 22 + 3);
2526
                 //this.serial.Serial_DataSend(MBIC_BootLoaderData, 1024 + 22 + 3);
2565
                 //this.serial.Serial_DataSend(MBIC_BootLoaderData, 1024 + 22 + 3);
2527
 
2566
 
@@ -2668,7 +2707,7 @@ public byte[] MBIC_BootLoader_DataArray;
2668
             temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_CrcIndex] = 5;
2707
             temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_CrcIndex] = 5;
2669
             temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data] = Convert.ToByte(Convert.ToByte(comboBox_BankSel.SelectedIndex) + 1);
2708
             temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data] = Convert.ToByte(Convert.ToByte(comboBox_BankSel.SelectedIndex) + 1);
2670
             UInt16 CRCRET = crc.CRC16_Generate(temp_buf, Length);
2709
             UInt16 CRCRET = crc.CRC16_Generate(temp_buf, Length);
2671
-            temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + 1] = Convert.ToByte(CRCRET & 0xFF00 >> 8);
2710
+            temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + 1] = Convert.ToByte((CRCRET & 0xFF00) >> 8);
2672
             temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + 2] = Convert.ToByte(CRCRET & 0x00FF);
2711
             temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + 2] = Convert.ToByte(CRCRET & 0x00FF);
2673
             temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + 3] = 0xeb;
2712
             temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + 3] = 0xeb;
2674
             serial.Serial_DataSend(temp_buf, temp_buf.Length);
2713
             serial.Serial_DataSend(temp_buf, temp_buf.Length);
@@ -2742,7 +2781,7 @@ public byte[] MBIC_BootLoader_DataArray;
2742
             tempdata[0] = 0xbe;
2781
             tempdata[0] = 0xbe;
2743
             tempdata[1] = (byte)Bluecell_BootProtocol.DATATYPE.Bluecell_Factory_Set;
2782
             tempdata[1] = (byte)Bluecell_BootProtocol.DATATYPE.Bluecell_Factory_Set;
2744
             tempdata[2] = 0;
2783
             tempdata[2] = 0;
2745
-            tempdata[3] = (byte)(tempdata.Length - 4);
2784
+            tempdata[3] = (byte)(tempdata.Length - 3);
2746
             tempdata[5] = 1;
2785
             tempdata[5] = 1;
2747
             UInt16 CRCRET = crc.CRC16_Generate(tempdata, tempdata[(int)Bluecell_ProtIndex_p.Bluecell_Length_L]);
2786
             UInt16 CRCRET = crc.CRC16_Generate(tempdata, tempdata[(int)Bluecell_ProtIndex_p.Bluecell_Length_L]);
2748
             tempdata[6] = Convert.ToByte((CRCRET & 0xFF00) >> 8);
2787
             tempdata[6] = Convert.ToByte((CRCRET & 0xFF00) >> 8);
@@ -2914,6 +2953,85 @@ public byte[] MBIC_BootLoader_DataArray;
2914
             Process.GetCurrentProcess().Kill();
2953
             Process.GetCurrentProcess().Kill();
2915
 
2954
 
2916
         }
2955
         }
2956
+
2957
+        private void button_ManufactureSet_Click(object sender, EventArgs e)
2958
+        {
2959
+            byte[] temp_buf = new byte[10];
2960
+            Button button = (Button)sender;
2961
+            DATATYPE datatype;
2962
+            ReqTimer_Cnt = 0;
2963
+            char[] tempchardata;
2964
+            string s3 = DateTime.Now.ToString("yyMMdd");
2965
+
2966
+            tempchardata = s3.ToCharArray();
2967
+            temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data] = DataToConvertHex(s3)[0];
2968
+            temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + 1] = DataToConvertHex(s3)[1];
2969
+            temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + 2] = DataToConvertHex(s3)[2];
2970
+            datatype = DATATYPE.Bluecell_ManufactureDateSet;
2971
+
2972
+            temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Header] = BLUECELL_HEADER;
2973
+            temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Type] = Convert.ToByte(datatype);
2974
+            temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Length_H] = ((7 & 0xFF00) >> 8);
2975
+            temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Length_L] = (7 & 0x00FF);
2976
+            temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_CrcIndex] = 5;
2977
+            //temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data] = 0;
2978
+            UInt16 CRCRET = crc.CRC16_Generate(temp_buf, temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Length_L]);
2979
+            temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + 3] = Convert.ToByte((CRCRET & 0xFF00) >> 8);//CRC
2980
+            temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + 4] = Convert.ToByte(CRCRET & 0x00FF);//CRC
2981
+            serial.Serial_DataSend(temp_buf, temp_buf.Length);
2982
+        }
2983
+        //Serial Number : BL-J37C00-20050004  Example 
2984
+        private void button_SerialNumverSet_Click(object sender, EventArgs e)
2985
+        {
2986
+            byte[] temp_buf = new byte[25];
2987
+            int i = 0;
2988
+            Button button = (Button)sender;
2989
+            DATATYPE datatype;
2990
+            ReqTimer_Cnt = 0;
2991
+            char[] data = textBox_SerialNumber.Text.ToCharArray();
2992
+
2993
+            //temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data] = textBox_SerialNumber.Text.Split();
2994
+            datatype = DATATYPE.Bluecell_SerialNumberSet;
2995
+            for (i = 0; i < data.Length; i++)
2996
+                temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + i] = (Byte)data[i];
2997
+
2998
+            temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Header] = BLUECELL_HEADER;
2999
+            temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Type] = Convert.ToByte(datatype);
3000
+            temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Length_H] = ((22 & 0xFF00) >> 8);
3001
+            temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Length_L] = (22 & 0x00FF);
3002
+            temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_CrcIndex] = 5;
3003
+            //temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data] = 0;
3004
+            UInt16 CRCRET = crc.CRC16_Generate(temp_buf, temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Length_L]);
3005
+            temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + i++] = Convert.ToByte((CRCRET & 0xFF00) >> 8);//CRC
3006
+            temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + i++] = Convert.ToByte(CRCRET & 0x00FF);//CRC
3007
+            serial.Serial_DataSend(temp_buf, temp_buf.Length);
3008
+        }
3009
+
3010
+        private void button_PCBVersionSet_Click(object sender, EventArgs e)
3011
+        {
3012
+            byte[] temp_buf = new byte[9];
3013
+            int i = 0;
3014
+            Button button = (Button)sender;
3015
+            DATATYPE datatype;
3016
+            ReqTimer_Cnt = 0;
3017
+            string[] data = textBox_PcbVersion.Text.Split('.');
3018
+
3019
+            //temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data] = textBox_SerialNumber.Text.Split();
3020
+            datatype = DATATYPE.Bluecell_PCBVersionSet;
3021
+            for (i = 0; i < data.Length; i++)
3022
+                temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + i] = Convert.ToByte(data[i]);
3023
+
3024
+            temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Header] = BLUECELL_HEADER;
3025
+            temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Type] = Convert.ToByte(datatype);
3026
+            temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Length_H] = ((6 & 0xFF00) >> 8);
3027
+            temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Length_L] = (6 & 0x00FF);
3028
+            temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_CrcIndex] = 5;
3029
+            //temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data] = 0;
3030
+            UInt16 CRCRET = crc.CRC16_Generate(temp_buf, temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_Length_L]);
3031
+            temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + i++] = Convert.ToByte((CRCRET & 0xFF00) >> 8);//CRC
3032
+            temp_buf[(int)Bluecell_ProtIndex_p.Bluecell_data + i++] = Convert.ToByte(CRCRET & 0x00FF);//CRC
3033
+            serial.Serial_DataSend(temp_buf, temp_buf.Length);
3034
+        }
2917
     }
3035
     }
2918
     class AutoClosingMessageBox
3036
     class AutoClosingMessageBox
2919
     {
3037
     {

BIN
Jdas_Mbic/bin/Debug/Jdas_Mbic.pdb


BIN
Jdas_Mbic/bin/Debug/Jdas_Mbic1.4.exe


BIN
Jdas_Mbic/bin/Debug/Jdas_Mbic.exe


BIN
Jdas_Mbic/obj/Debug/Jdas_Mbic.csproj.GenerateResource.cache


BIN
Jdas_Mbic/obj/Debug/Jdas_Mbic.csproj.ResolveComReference.cache


BIN
Jdas_Mbic/obj/Debug/Jdas_Mbic.exe


BIN
Jdas_Mbic/obj/Debug/Jdas_Mbic.pdb