<commit_before>package org.traccar.protocol;

import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.LinkedList;
import java.util.List;
import java.util.TimeZone;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.traccar.GenericProtocolDecoder;
import org.traccar.helper.Log;
import org.traccar.model.DataManager;
import org.traccar.model.Position;

public class ST210ProtocolDecoder extends GenericProtocolDecoder {
	

    public ST210ProtocolDecoder(DataManager dataManager, Integer resetDelay) {
		super(dataManager, resetDelay);
	}

	private enum ST210FIELDS {
        HDR_STATUS("SA200STT;", 
        		"Status Report"), 
        		HDR_EMERGENCY("SA200EMG;","Emergency Report"), 
                HDR_EVENT("SA200EVT;", "Event Report"), 
                HDR_ALERT("SA200ALT;","Alert Report"), 
                HDR_ALIVE("SA200ALV;","Alive Report"), 
                DEV_ID("(\\d+);", "Device ID"), 
                SW_VER("(\\d{3});", "Software Release Version"), 
                DATE("(\\d+);","GPS date (yyyymmdd) Year + Month + Day"), 
                TIME("(\\d{2}:\\d{2}:\\d{2});","GPS time (hh:mm:ss) Hour : Minute : Second"), 
                CELL("(\\d{2}\\w\\d{2});","Location Code ID (3 digits hex) + Serving Cell BSIC(2 digits decimal)"), 
                LAT("(-\\d{2}.\\d+);", "Latitude (+/-xx.xxxxxx)"), 
                LON("(-\\d{3}.\\d+);", "Longitude (+/-xxx.xxxxxx)"), 
                SPD("(\\d{3}.\\d{3});","Speed in km/h - This value returns to 0 when it is over than 200,000Km"), 
                CRS("(\\d{3}.\\d{2});", "Course over ground in degree"),
                SATT("(\\d+);", "Number of satellites"),
                FIX("(\\d);","GPS is fixed(1)\n" + "GPS is not fixed(0)"), 
                DIST("(\\d+);","Traveled ddistance in meter"), 
                PWR_VOLT("(\\d+.\\d{2});","Voltage value of main power"), 
                IO("(\\d+);","Current I/O status of inputs and outputs."), 
                MODE("(\\d);","1 = Idle mode (Parking)\n" + "2 = Active Mode (Driving)"),
                MSG_NUM("(\\d{4})","Message number - After 9999 is reported, message number returns to 0000"), 
                EMG_ID("(\\d)", "Emergency type"), 
                EVT_ID("(\\d);", "Event type"), 
                ALERT_ID("(\\d);", "Alert type");

        private String pattern;<commit_msg>Correction of CELL regex pattern<commit_after>package org.traccar.protocol;

import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.LinkedList;
import java.util.List;
import java.util.TimeZone;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.traccar.GenericProtocolDecoder;
import org.traccar.helper.Log;
import org.traccar.model.DataManager;
import org.traccar.model.Position;

public class ST210ProtocolDecoder extends GenericProtocolDecoder {
	

    public ST210ProtocolDecoder(DataManager dataManager, Integer resetDelay) {
		super(dataManager, resetDelay);
	}

	private enum ST210FIELDS {
        HDR_STATUS("SA200STT;", 
        		"Status Report"), 
        		HDR_EMERGENCY("SA200EMG;","Emergency Report"), 
                HDR_EVENT("SA200EVT;", "Event Report"), 
                HDR_ALERT("SA200ALT;","Alert Report"), 
                HDR_ALIVE("SA200ALV;","Alive Report"), 
                DEV_ID("(\\d+);", "Device ID"), 
                SW_VER("(\\d{3});", "Software Release Version"), 
                DATE("(\\d+);","GPS date (yyyymmdd) Year + Month + Day"), 
                TIME("(\\d{2}:\\d{2}:\\d{2});","GPS time (hh:mm:ss) Hour : Minute : Second"), 
                CELL("(\\w{3}\\d{2});","Location Code ID (3 digits hex) + Serving Cell BSIC(2 digits decimal)"), 
                LAT("(-\\d{2}.\\d+);", "Latitude (+/-xx.xxxxxx)"), 
                LON("(-\\d{3}.\\d+);", "Longitude (+/-xxx.xxxxxx)"), 
                SPD("(\\d{3}.\\d{3});","Speed in km/h - This value returns to 0 when it is over than 200,000Km"), 
                CRS("(\\d{3}.\\d{2});", "Course over ground in degree"),
                SATT("(\\d+);", "Number of satellites"),
                FIX("(\\d);","GPS is fixed(1)\n" + "GPS is not fixed(0)"), 
                DIST("(\\d+);","Traveled ddistance in meter"), 
                PWR_VOLT("(\\d+.\\d{2});","Voltage value of main power"), 
                IO("(\\d+);","Current I/O status of inputs and outputs."), 
                MODE("(\\d);","1 = Idle mode (Parking)\n" + "2 = Active Mode (Driving)"),
                MSG_NUM("(\\d{4})","Message number - After 9999 is reported, message number returns to 0000"), 
                EMG_ID("(\\d)", "Emergency type"), 
                EVT_ID("(\\d);", "Event type"), 
                ALERT_ID("(\\d);", "Alert type");

        private String pattern;
{'fraction_non_alphanumeric': 0.18951612903225806, 'fraction_numerical': 0.02379032258064516, 'mean_word_length': 2.4332179930795848, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7583793', 'n_tokens_mistral': 1779, 'n_tokens_neox': 1577, 'n_words': 341}