2.2.0 • Published 3 years ago

vbb-stations-with-wifi v2.2.0

Weekly downloads
2
License
Unlicense
Repository
github
Last release
3 years ago

vbb-stations-with-wifi

VBB stations with free wifi and their BSSIDs. Contribute!

npm version build status ISC-licensed support me via GitHub Sponsors chat with me on Twitter

Installing

npm install vbb-stations-with-wifi

Usage

const stations = require('vbb-stations-with-wifi')

console.log(stations['900000023101']) // U Ernst-Reuter-Platz
{
	wifi: true,
	accessPoints: [ {
		type: 'platform',
		platform: null,
		lines: [
			['U2', '900000022201'] // U Deutsche Oper
		],
		position: 0.35,
		bssid: '00:81:c4:e7:0d:8f',
		mac: null
	}, {
		type: 'platform',
		platform: null,
		lines: [
			['U2', '900000022201'] // U Deutsche Oper
		],
		position: 0.65,
		bssid: '00:81:c4:e7:0e:7f',
		mac: null
	}, {
		type: 'other',
		comment: 'entrance to U2 towards Pankow',
		bssid: '00:81:c4:9d:b4:af',
		mac: null
	}, {
		type: 'other',
		comment: 'entrance to U2 towards Ruhleben',
		bssid: '00:f6:63:af:f8:af',
		mac: null
	} ]
}

By BSSID

const byBssid = require('vbb-stations-with-wifi/by-bssid')

console.log(byBssid['00:81:c4:e7:0e:7f'])
{
	station: '900000023101',
	type: 'platform',
	platform: null,
	lines: [
		['U2', '900000022201'] // U Deutsche Oper
	],
	position: 0.65,
	bssid: '00:81:c4:e7:0e:7f',
	mac: null
}

Data structure

index.js looks like this:

{
	'station-id-123': {
		wifi: true,
		accessPoints: […]
	}
	// …
}

An item in accessPoints should either have type: 'platform' (an access point located close to or at a platform) or type: 'other' (an access point located somewhere else). The markup for type: 'platform' is as follows:

keydescriptionrequiredexample
platformthe name of the platformno'3a'
linesan array of pairs: 1) a line and 2) the ID of the next station on this lineyes[['U2', '900000022201']]
positionposition of the access point at the platform, between 0 (rear end of the station) and 1 (front end of the station) ¹yes0.2
bssidBSSID, lower caseyes'00:f6:63:cc:00:9f'
macMAC address, lower caseno'00:f6:63:cc:00:9f'

¹ "front end" is the end of the station that the a vehicle running at the platform points to (not where the "front end" of the vehicle will be).

Pro tip: Use vbb-stations-cli to find station IDs.